I am trying to use the new IISAdministration
module to create an IIS site (I know I can use the old WebAdministration
module, but this is now the recommended approach).
When I run the following script, I get the error that follows it:
Import-Module IISAdministration
New-IISSite -Name "IdpSAMLBridge" -BindingInformation "*:7777:demo.something.com" -PhysicalPath "C:\inetpub\IdpSAMLBridge\abc5" -Protocol https -CertificateThumbPrint "284c9018f6f6258a05c48ab9e34f6fe2133cff1b" -CertStoreLocation "Cert:\LocalMachine\My"
And the error:
New-IISSite : A parameter cannot be found that matches parameter name 'Protocol'.
... indingInformation '*:12031:ictctst.incontrol.local' -Protocol https - ...
~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-IISSite], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.IIS.Powershell.Commands.NewIISSiteCommand
My code seems to be correct, if this doco is still correct and current.
If I swap around the parameters, I get a similar error, but a different parameter:
New-IISSite : A parameter cannot be found that matches parameter name 'CertificateThumbPrint'.
At C:\Users\David\Documents\scripts\create-idp.ps1:3 char:132
+ ... tion '*:12031:ictctst.incontrol.local' -CertificateThumbPrint 'f62d70 ...
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-IISSite], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.IIS.Powershell.Commands.NewIISSiteCommand
However, if I remove some of the parameters, the command works:
Import-Module IISAdministration
New-IISSite -Name "IdpSAMLBridge" -PhysicalPath 'C:\inetpub\IdpSAMLBridge\abc5' -BindingInformation '*:12033:demo.something.com'
Any ideas what the issue could be?
Thanks