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

**URL:** https://forums.powershell.org/t/xwebadmin-unexpected-token-present-name-default-in-expression-or-statement/5830
**Category:** DSC
**Created:** [February 22, 2016, 7:32am UTC](https://forums.powershell.org/t/xwebadmin-unexpected-token-present-name-default-in-expression-or-statement/5830 "2016-02-22T07:32:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![nick-kou](https://avatars.discourse-cdn.com/v4/letter/n/bb73d2/32.png) [@nick-kou](https://forums.powershell.org/u/nick-kou)
#### Post date: [February 22, 2016, 7:32am UTC](https://forums.powershell.org/t/xwebadmin-unexpected-token-present-name-default-in-expression-or-statement/5830/1 "2016-02-22T07:32:44Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)
#### Post date: [February 22, 2016, 7:37am UTC](https://forums.powershell.org/t/xwebadmin-unexpected-token-present-name-default-in-expression-or-statement/5830/2 "2016-02-22T07:37:14Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![nick-kou](https://avatars.discourse-cdn.com/v4/letter/n/bb73d2/32.png) [@nick-kou](https://forums.powershell.org/u/nick-kou)
#### Post date: [February 22, 2016, 7:46am UTC](https://forums.powershell.org/t/xwebadmin-unexpected-token-present-name-default-in-expression-or-statement/5830/3 "2016-02-22T07:46:09Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)
#### Post date: [February 22, 2016, 7:46am UTC](https://forums.powershell.org/t/xwebadmin-unexpected-token-present-name-default-in-expression-or-statement/5830/4 "2016-02-22T07:46:38Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)
#### Post date: [May 16, 2024, 9:17pm UTC](https://forums.powershell.org/t/xwebadmin-unexpected-token-present-name-default-in-expression-or-statement/5830/5 "2024-05-16T21:17:08Z")

</div>


