尝试使用Powershell编写从IIS网站删除特定自定义错误的脚本。
我到目前为止:
Remove-WebConfigurationProperty -Filter "/system.webServer/httpErrors/error[@statusCode='403' and @subStatusCode='4']" -Location IIS:\Sites\www.mysite.com
但是运行失败并发出警告:
Remove-WebConfigurationProperty : Cannot bind argument to parameter 'Name' because it is an empty string.
我不知道在这里为Name
参数指定了什么 - 而且删除了WebConfigurationProperty可疑的文档...任何想法?
答案 0 :(得分:3)
Clear-WebConfiguration -Filter "/system.webServer/httpErrors/error[@statusCode='403' and @subStatusCode='4']" -Location IIS:\Sites\www.mysite.com