Quantcast
Channel: Configuration & Scripting
Viewing all articles
Browse latest Browse all 780

PS Script to Point All Error Pages to on HTML in a New VD

$
0
0

Hi, I'm trying to cobble together a PS script to point all error pages from their default to an html page I've placed in a new VDir.  I have little PS experience, but here's what I have found...

Import-Module WebAdministration
dir "IIS:\Sites\Default Web Site" | %
{
Set-WebConfigurationProperty -Filter "/system.webServer/httpErrors/error[@statusCode='*']" -
Location "IIS:\Sites\Default Web Site\$($_.name)" -Name /CustomErrors/HTTP533.html -Value "$($_.physicalPath)\CustomErrors\HTTP553.html"
}

Running the script causes a prompt to ask, "Supply values for the following parameters:  Name:  Value:"

What am I missing?

Thanks


Viewing all articles
Browse latest Browse all 780

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>