Created
September 25, 2014 16:40
-
-
Save rodmhgl/7e5547ce5157c1c59996 to your computer and use it in GitHub Desktop.
Get-STTinyURL
This file contains 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
function Get-STTinyURL { | |
param( | |
[Parameter(Mandatory=$true, | |
ValueFromPipeline=$true, | |
Position=0) | |
] | |
[String[]]$OriginalURL) | |
Process { | |
$OriginalURL | ForEach-Object { | |
Write-Verbose -Message $_ | |
$url = "http://tinyurl.com/api-create.php?url=$_" | |
$webclient = New-Object -TypeName System.Net.WebClient | |
return $webclient.DownloadString($url) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment