Hi guys,
I’m trying to publish a dsc config in Azure. I have a vm in Azure, and installed PowerShell 5
PS C:\Windows\system32> $PSVersionTable Name Value ---- ----- PSVersion 5.0.10514.6 WSManStackVersion 3.0 SerializationVersion 1.1.0.1 CLRVersion 4.0.30319.42000 BuildVersion 10.0.10514.6 PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} PSRemotingProtocolVersion 2.3
and xWebAdministration
PS C:\Windows\system32> Get-DscResource PowerShell xIisFeatureDelegation xWebAdministration 1.9.0.0 {OverrideMode, SectionName, DependsOn, PsDscRun... PowerShell xIisHandler xWebAdministration 1.9.0.0 {Ensure, Name, DependsOn, PsDscRunAsCredential} PowerShell xIisMimeTypeMapping xWebAdministration 1.9.0.0 {Ensure, Extension, MimeType, DependsOn...} PowerShell xIisModule xWebAdministration 1.9.0.0 {Name, Path, RequestPath, Verb...} PowerShell xSSLSettings xWebAdministration 1.9.0.0 {Bindings, Name, DependsOn, Ensure...} PowerShell xWebApplication xWebAdministration 1.9.0.0 {Name, PhysicalPath, WebAppPool, Website...} PowerShell xWebAppPool xWebAdministration 1.9.0.0 {Name, autoShutdownExe, autoShutdownParams, aut... PowerShell xWebAppPoolDefaults xWebAdministration 1.9.0.0 {ApplyTo, DependsOn, IdentityType, ManagedRunti... PowerShell xWebConfigKeyValue xWebAdministration 1.9.0.0 {ConfigSection, Key, WebsitePath, DependsOn...} PowerShell xWebsite xWebAdministration 1.9.0.0 {Name, PhysicalPath, ApplicationPool, BindingIn... PowerShell xWebSiteDefaults xWebAdministration 1.9.0.0 {ApplyTo, AllowSubDirConfig, DefaultApplication... PowerShell xWebVirtualDirectory xWebAdministration 1.9.0.0 {Name, PhysicalPath, WebApplication, Website...}
However, when I complie the below configuration, it came across the error. it has the red squiggly at xWebsite DefaultSite section > Ensure = “Present”.
And the error is:
Unexpected token ‘present"
Name = "Default’ in expression or statement.
There is an incomplete property assignment block in the instance definition.
The dsc config:
Configuration FourthCoffee { Import-DscResource -Module @{ModuleName = 'xWebAdministration';ModuleVersion='1.3.2.4'} # Install the IIS role WindowsFeature IIS { Ensure = “Present” Name = “Web-Server” } # Install the ASP .NET 4.5 role WindowsFeature AspNet45 { Ensure = “Present” Name = “Web-Asp-Net45″ } # Stop the default website xWebsite DefaultSite { Ensure = “Present” Name = “Default Web Site” State = “Stopped” PhysicalPath = “C:\inetpub\wwwroot” DependsOn = “[WindowsFeature]IIS” } # Copy the website content File WebContent { Ensure = “Present” SourcePath = “C:\Program Files\WindowsPowerShell\Modules\xWebAdministration\BakeryWebsite” DestinationPath = “C:\inetpub\FourthCoffee” Recurse = $true Type = “Directory” DependsOn = “[WindowsFeature]AspNet45″ } # Create a new website xWebsite BakeryWebSite { Ensure = “Present” Name = “FourthCoffee” State = “Started” PhysicalPath = “C:\inetpub\FourthCoffee” DependsOn = “[File]WebContent” } }
Any help will be apperciated.
Thanks,
Nick