Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

PowerShell – Get-TinyURL API Call

Posted on December 14, 2015February 12, 2016 By David Kittell
clear
Function Get-TinyURL { 
    #PowerShell - Get-TinyURL API Call
    param (
        [Parameter(Mandatory=$true,ValueFromPipeline=$true)] 
        [String]
        $sHTTPLink
    )

    if ($sHTTPLink.StartsWith("http://") -eq $true -or $sHTTPLink.StartsWith("https://") -eq $true)
        {
            if ($WebClient -eq $null) {$Global:WebClient=new-object System.Net.WebClient }
            $webClient.DownloadString("http://tinyurl.com/api-create.php?url="  + [System.Web.HttpUtility]::UrlEncode($sHTTPLink))
        }
    else
        {
            Write-Output "Bad Link, please include http:// or https://"
        }
}

Get-TinyURL "http://google.com"

GitHub: https://gist.github.com/dkittell/d11d6bf7ac03d5c52355

Originally Posted on December 14, 2015
Last Updated on February 12, 2016
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code PowerShell

Post navigation

Previous post
Next post

Related Posts

PowerShell – Open URL In Windows Default Browser

Posted on January 2, 2020

As I have found and lost this script from jkdba.com a few times I’m posting it here so I can remember it :) function Invoke-URLInDefaultBrowser { <# .SYNOPSIS Cmdlet to open a URL in the User’s default browser. .DESCRIPTION Cmdlet to open a URL in the User’s default browser. .PARAMETER…

Read More

MacPorts / HomeBrew – Rip CD tracks from terminal

Posted on May 22, 2016November 5, 2017

I’m mainly doing this project for my church where the CD will typically only have one track and the MP3 bitrate is acceptable at 64 kbit/s Yes there are faster options that also are free but this is the best option I’ve found to make it an easy process someone…

Read More

PowerShell – Windows Active Directory – Compare User Groups

Posted on January 2, 2020

$user1 = "administrator" $user2 = "dkittell" # Left arrow means user1 has the permissions but user2 does not # Right arrow means user2 has the permissions but user1 does not diff(get-adprincipalgroupmembership -Identity $user1)(get-adprincipalgroupmembership -Identity $user2) -property ‘name’ All information on this site is shared with the intention to help. Before…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes