Windows Powershell Script for testing a list of Redirected URL's
问题 I want to a Windows PowerShell script that can test a list of URL's which are redirected. I want there status code and there target URL. I am getting for a single URL, however unable to get it for a list of URL's. If anyone can help me with the above. 回答1: Create a [WebRequest] object and set the AllowAutoRedirect property to $false : # You could read this list from a file if necessary $urls = @('http://stackoverflow.com/') foreach($url in $urls){ try{ # Create WebRequest object, disallow