Expand Shortened URLs
# Create Web Request Object $request = [System.Net.WebRequest]::Create($url) # Make it think we are using Edge on Windows 10. Required for some shorteners. $request.UserAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246' # Get the expanded URL $request.GetResponse().ResponseUri.AbsoluteUri