Hi
Apologies for all the questions. Im having issues getting my head around powershell at the moment....
How can i add a webbinding only if it does not already exist? The following adds the binding, but if it already exists it still adds it but stops the site. I would like to throw an exception if the binding already exists.
$binding = (@{protocol="http";bindingInformation="*:80:binding1.site.com"})
new-item "iis:\sites\$sitename" -type site -physicalPath c:\inetpub\$sitename\website -bindings $binding -id "$sitenumber"