5

I have the following in my DSC configuration:

        xWebApplication StaffDirectoryApp {
            Website = "MySite"
            Name = "MyApp"
            WebAppPool = "MyPool"
            PhysicalPath = $Destination
            Ensure = "Present"
            PreloadEnabled = $true
        }

This seems to be working ok, but I also want to use the AuthenticationInfo property (although documentation seems to say it should be AuthenticationInformation, it's not).

The only example I can find is in one of the unit tests on GitHub, and their usage is something like this:

AuthenticationInfo = New-CimInstance -ClassName MSFT_xWebApplicationAuthenticationInformation `
                        -ClientOnly `
                        -Property @{ Anonymous = $false; Basic = $false; Digest = $false; Windows = $true }

This, however, yields the following:

Convert property 'AuthenticationInfo' value from type 'STRING' to type 'INSTANCE' failed

How should I set this property?

kettch
  • 287
  • 1
  • 3
  • 11

1 Answers1

3

Try the following syntax:

   xWebApplication StaffDirectoryApp {
        Website = "MySite"
        Name = "MyApp"
        WebAppPool = "MyPool"
        PhysicalPath = $Destination
        Ensure = "Present"
        PreloadEnabled = $true
        AuthenticationInfo = MSFT_xWebApplicationAuthenticationInformation
        {
        Anonymous = $false
        Basic = $false
        Digest = $false
        Windows = $true
        }
   }

I don't know why the code with New-CimInstance doesn't work, but this one should to the trick.

Peter Hahndorf
  • 14,058
  • 3
  • 41
  • 58