Trying to use Powershell to script the removal of specific custom errors from an IIS website.
I have got this far:
Remove-WebConfigurationProperty -Filter "/system.webServer/httpErrors/error[@statusCode='403' and @subStatusCode='4']" -Location IIS:\Sites\www.mysite.com
but running that fails with a warning that:
Remove-WebConfigurationProperty : Cannot bind argument to parameter 'Name' because it is an empty string.
I have no idea what to specify for the Name parameter here – and Remove-WebConfigurationProperty is woefully underdocumented… any ideas?
Ah… cracked it. It’s not Remove-WebConfigurationProperty, it’s Clear-WebConfiguration that’s used in this context: