Encode\Decode URL with Powershell

Problems with URL is you can not pass everything to the internet, like spaces some special chars – ~ : \ / ? etc which could cause some issues and are not valid for a URL format. So you’ve to change them to a valid ASCII format which is accepted in a URL format so here is a quick PowerShell tip –

Changing a URL candidate to valid ASCII format is called URL Encoding and can be done like in the below image using System.Web.HttpUtility class in .Net framework. You can also perform its reverse which is call URL Decoding.


You can read more about the what and the whys of these terms on the World Wide Web Consortium site HERE




2 thoughts on “Encode\Decode URL with Powershell

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s