SQL Workbench/J Git Repository https://www.sql-workbench.eu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
480 B

function Get-RedirectedUrl
{
Param (
[Parameter(Mandatory=$true)]
[String]$URL
)
$request = [System.Net.WebRequest]::Create($url)
$request.AllowAutoRedirect=$false
$response=$request.GetResponse()
$successStatus =@("Found","TemporaryRedirect","PermanentRedirect","Redirect","MovedPermanently","Moved")
If ($successStatus -Contains $response.StatusCode)
{
$response.GetResponseHeader("Location")
}
}