xWebAdmin Unexpected token 'present" name ="Default' in expression or statement

Welcome Forums DSC (Desired State Configuration) xWebAdmin Unexpected token 'present" name ="Default' in expression or statement

This topic contains 3 replies, has 3 voices, and was last updated by

3 years, 2 months ago.

  • Author
  • #35527

    Topics: 2
    Replies: 1
    Points: 0
    Rank: Member

    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                                                                                                                                   
    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       {OverrideMode, SectionName, DependsOn, PsDscRun...
    PowerShell      xIisHandler               xWebAdministration       {Ensure, Name, DependsOn, PsDscRunAsCredential}   
    PowerShell      xIisMimeTypeMapping       xWebAdministration       {Ensure, Extension, MimeType, DependsOn...}       
    PowerShell      xIisModule                xWebAdministration       {Name, Path, RequestPath, Verb...}                
    PowerShell      xSSLSettings              xWebAdministration       {Bindings, Name, DependsOn, Ensure...}            
    PowerShell      xWebApplication           xWebAdministration       {Name, PhysicalPath, WebAppPool, Website...}      
    PowerShell      xWebAppPool               xWebAdministration       {Name, autoShutdownExe, autoShutdownParams, aut...
    PowerShell      xWebAppPoolDefaults       xWebAdministration       {ApplyTo, DependsOn, IdentityType, ManagedRunti...
    PowerShell      xWebConfigKeyValue        xWebAdministration       {ConfigSection, Key, WebsitePath, DependsOn...}   
    PowerShell      xWebsite                  xWebAdministration       {Name, PhysicalPath, ApplicationPool, BindingIn...
    PowerShell      xWebSiteDefaults          xWebAdministration       {ApplyTo, AllowSubDirConfig, DefaultApplication...
    PowerShell      xWebVirtualDirectory      xWebAdministration       {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=''}
        # 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.


  • #35528

    Topics: 9
    Replies: 2322
    Points: 0
    Rank: Member

    Seems to be those weird smart quotes that are around many of your strings, particularly the one that's closing "Web-Asp-Net45" and "[WindowsFeature]AspNet45". When I replaced those with a plain double-quotation mark, the rest seemed to parse okay.

  • #35531

    Topics: 2
    Replies: 1
    Points: 0
    Rank: Member

    Thanks Dave. That is so embarrass... I tried to fix this for a few hours.
    I copy the conf from technet, it that case scenario I always think there is something wrong with my setup. anyway, thanks for your support.

  • #35532

    Topics: 13
    Replies: 4872
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    Notably, if you copy and paste from a website, you'll often end up with non-straight quotes. It's bitten me more than once.

The topic ‘xWebAdmin Unexpected token 'present" name ="Default' in expression or statement’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort