I'm running the following to set custom error pages in IIS. Does this cmdlet even work? Has anybody gotten it to work?
Add-WebConfiguration -Filter "/System.WebServer/HttpErrors/error" -Value @{statusCode = "404"; subStatusCode = "100"; prefixLanguagePath = "$null"; path="/util/400-100.asp"; responseMode = "ExecuteURL"} -Force -Verbose
This is the verbose output I get, but the applicationHost.config doesn't change and the custom error page is not added:
VERBOSE: Performing the operation "Add-WebConfiguration" on target "-PSPath MACHINE/WEBROOT/APPHOST -Value @{responseMode="ExecuteURL";path="/error/400-100.asp";subStatusCode="100";statusCode="404";prefixLanguagePath=""} -Filter
/system.webServer/httpErrors/error[@statusCode='401' and @subStatusCode='-1']".
VERBOSE: Performing the operation "Add-WebConfiguration" on target "-PSPath MACHINE/WEBROOT/APPHOST -Value @{responseMode="ExecuteURL";path="/error/400-100.asp";subStatusCode="100";statusCode="404";prefixLanguagePath=""} -Filter
/system.webServer/httpErrors/error[@statusCode='404' and @subStatusCode='-1']".
VERBOSE: Performing the operation "Add-WebConfiguration" on target "-PSPath MACHINE/WEBROOT/APPHOST -Value @{responseMode="ExecuteURL";path="/error/400-100.asp";subStatusCode="100";statusCode="404";prefixLanguagePath=""} -Filter
/system.webServer/httpErrors/error[@statusCode='405' and @subStatusCode='-1']".
VERBOSE: Performing the operation "Add-WebConfiguration" on target "-PSPath MACHINE/WEBROOT/APPHOST -Value @{responseMode="ExecuteURL";path="/error/400-100.asp";subStatusCode="100";statusCode="404";prefixLanguagePath=""} -Filter
/system.webServer/httpErrors/error[@statusCode='406' and @subStatusCode='-1']".
VERBOSE: Performing the operation "Add-WebConfiguration" on target "-PSPath MACHINE/WEBROOT/APPHOST -Value @{responseMode="ExecuteURL";path="/error/400-100.asp";subStatusCode="100";statusCode="404";prefixLanguagePath=""} -Filter
/system.webServer/httpErrors/error[@statusCode='412' and @subStatusCode='-1']".
VERBOSE: Performing the operation "Add-WebConfiguration" on target "-PSPath MACHINE/WEBROOT/APPHOST -Value @{responseMode="ExecuteURL";path="/error/400-100.asp";subStatusCode="100";statusCode="404";prefixLanguagePath=""} -Filter
/system.webServer/httpErrors/error[@statusCode='500' and @subStatusCode='-1']".
VERBOSE: Performing the operation "Add-WebConfiguration" on target "-PSPath MACHINE/WEBROOT/APPHOST -Value @{responseMode="ExecuteURL";path="/error/400-100.asp";subStatusCode="100";statusCode="404";prefixLanguagePath=""} -Filter
/system.webServer/httpErrors/error[@statusCode='501' and @subStatusCode='-1']".
VERBOSE: Performing the operation "Add-WebConfiguration" on target "-PSPath MACHINE/WEBROOT/APPHOST -Value @{responseMode="ExecuteURL";path="/error/400-100.asp";subStatusCode="100";statusCode="404";prefixLanguagePath=""} -Filter
/system.webServer/httpErrors/error[@statusCode='502' and @subStatusCode='-1']".
Any help is appreciated.