We use appcmd in our deployment scripts to configure the servers, I need to make sure that adding bindings to existing sites does not cause an error
C:\Windows\System32\inetsrv\appcmd.exe set site /site.name:"abc.com" /+bindings. [protocol='http',bindingInformation='*:80:alias-abc.com']
works, but in the next script run I get an error.
cannot add a duplicate collection record of type "binding" with the combined protocol of attribute keys, bindingInformation ', respectively, http, *: alias-abc.com'
Is there a way to check if a binding exists before adding it to appcmd
(powershell is not allowed - this should be either appcmd or another exe command line)
thanks
source share