Jonathan Medd's Blog
Scripting. Powershell, VMware, Windows, Active Directory & Exchange. All that kind of stuff…..
-
Using PowerShell to access the vExpert.me URL Shortener
Posted on December 6th, 2012 2 commentsDarren 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
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”

-
Thanks Jonathan for your idea.
I added some improvements to it here
http://vexpert.me/9L
Leave a reply
-









Maish January 17th, 2013 at 10:18