1
votes

I am running into a problem. When I go to create a website I get an error. Has anyone else ever ran into this issue?

VERBOSE: [CONT10SQLTEST]: [[xWebsite]CMSAuth] Physical Path of Website CMSAuth does not match the desired state. Cannot find path 'IIS:\Sites\CMSAuth' because it does not exist. + CategoryInfo : ObjectNotFound: (IIS:\Sites\CMSAuth:) [], CimException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand + PSComputerName : CONT10SQLTEST

VERBOSE: [CONT10SQLTEST]: LCM: [ End Test ] [[xWebsite]CMSAuth] in 1.9830 seconds. The PowerShell provider MSFT_xWebsite threw one or more non-terminating errors while running the Test-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details. + CategoryInfo : InvalidOperation: (:) [], CimException + FullyQualifiedErrorId : NonTerminatingErrorFromProvider + PSComputerName : CONT10SQLTEST

VERBOSE: [CONT10SQLTEST]: LCM: [ End Set ] The SendConfigurationApply function did not succeed. + CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException + FullyQualifiedErrorId : MI RESULT 1 + PSComputerName : CONT10SQLTEST

configuration iis
{
     node $env:computername
     {

          xWebsite CMSAuth
          {
               Ensure = "Present"
               Name = "CMSAuth"
               State = "Started"
               ApplicationPool = "CMSAuthAppPool"
               PhysicalPath = "E:\websites\CMSAuth\Website"
               BindingInfo = MSFT_xWebBindingInformation
                        {
                            Protocol = "HTTP"
                            Port = 80
                            HostName = "*"
                        }

          }
     }
}
2

2 Answers

3
votes

I've seen it.

I am using DSC Resource wave 4 / WebAdministration 1.2.

I fixed it by going in to the MSFT_xWebsite.psm1 file and replacing: $Website = Get-Website -Name $Name with $Website = Get-Website | Where Name -eq $Name

Get-Website -Name $Name returns all websites on the host, so the library thinks the site exists, but then fails when getting the properties in Test-TargetResource

I loaded the module directly, using Import-Module MSFT_xWebsite.psm1, and executed the functions to figure out what was failing. The error I got running the module function directly helped me find the failing catch block via the error message. The line numbers were still useless.

Hope that helps.

0
votes

If you don't want to edit the module yourself as described in the answer above, you can use the corresponding module cWebAdministration from PowerShell.org. It fixes the issue and can be imported alongside xWebAdministration if you need more modules than the two of cWebAdministration (cWebSite and cAppPool):

Import-DscResource -ModuleName cWebAdministration
Import-DscResource -ModuleName xWebAdministration