Using PowerShell to access the URL Shortener

Darren Wollard set up a very cool 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 ""


and specifically to access the short URL:



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.

4 thoughts on “Using PowerShell to access the URL Shortener

Comments are closed.