Skip to content

Instantly share code, notes, and snippets.

@rodmhgl
Created September 25, 2014 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodmhgl/7e5547ce5157c1c59996 to your computer and use it in GitHub Desktop.
Save rodmhgl/7e5547ce5157c1c59996 to your computer and use it in GitHub Desktop.
Get-STTinyURL
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