Last active
January 30, 2018 15:55
-
-
Save davewilson/6b16abe50ac27bc1c200 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Expands a shortened URL to its full URL | |
.DESCRIPTION | |
Expands a shortened URL to its full URL | |
.EXAMPLE | |
Get-FullURL http:/bit.ly/12345 | |
#> | |
function Get-FullURL | |
{ | |
Param | |
( | |
[Parameter(Mandatory=$true, | |
ValueFromPipelineByPropertyName=$true, | |
Position=0)] | |
$url | |
) | |
(Invoke-WebRequest -uri $url -MaximumRedirection 0 -ErrorAction Ignore).Headers.Location | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed trailing space