2014-10-17 8 views
5

我们APPCMD使用我们的部署脚本设置服务器,我需要确保添加绑定到现有网站不会引发错误APPCMD在将它添加到网站之前如何测试绑定是否存在?

C:\Windows\System32\inetsrv\appcmd.exe set site /site.name:"abc.com" 
/+bindings. [protocol='http',bindingInformation='*:80:alias-abc.com'] 

的作品,但在接下来的脚本运行我的错误..

不能添加型“结合”联合键attribuites“协议,bindingInformation”分别设置为重复的集合项“ HTTP,*:alias-abc.com”

有没有一种方法可以检查如果bindin克APPCMD

添加它之前存在(PowerShell是不允许的 - 因此,必须为APPCMD或其他命令行EXE)

感谢

回答

0

APPCMD有点欠缺搜索部门的事,但像这样应该可以工作:

C:\Windows\system32\inetsrv\appcmd.exe list site "abc.com" | findstr bindings:http/*:80 
相关问题