Scripting. Powershell, VMware, Windows, Active Directory & Exchange. All that kind of stuff…..
RSS icon Email icon Home icon
  • Using PowerShell to access the vExpert.me URL Shortener

    Posted on December 6th, 2012 Jonathan Medd 2 comments

    Darren Wollard set up a very cool vExpert.me URL shortener for vExperts to use. I was curious whether this was available programmatically and turns out it is with a simple URL query. You either need to supply your username and password in the query (bad) or secret code (less bad– tip: find it on the tools page after logging in to the admin site) . Then the query from PowerShell is as simple as

    
    $vExpertMe = Invoke-RestMethod -Uri "http://vexpert.me/yourls-api.php?signature=secretcode&action=shorturl&format=json&url=http://www.jonathanmedd.net/2012/10/powershell-v3-new-in-operator.html"
    
    $vExpertMe
    
    

    and specifically to access the short URL:

    
    $vExpertMe.shorturl
    
    

    vExpertMe

    Note: Be careful of the password you choose if you go down the username and password route to query the YOURLS API. It appears to not like special characters in the password. Thanks to Darren for helping me troubleshoot that.

     

    2 responses to “Using PowerShell to access the vExpert.me URL Shortener” RSS icon


    Leave a reply