Encoding and Decoding URLs in PowerShell Encoding and Decoding URLs in PowerShell
Joel Plaut

Joel Plaut

August 24, 2014

All Post
Encoding-and
Share:

URLs in SharePoint are often filled with “%20” in place of blanks, and other substitutions.

However, there are times when the original clean URL is desired. The “%20” references are known as “encoded” URls. URL encoding replaces unsafe ASCII characters with a “%” followed by two hexadecimal digits.

URLs can only be sent over the Internet using the ASCII character set. However for emailing or auditing URLs, sometimes the decoded URL is desired.

Here’s how to Encode and Decode an URL in PowerShell:

$EncodedURL = [System.Web.HttpUtility]::UrlEncode($URL)
$DecodedURL = [System.Web.HttpUtility]::UrlDecode($URL)

Industry-standard encoding is described in detail at: http://www.w3schools.com/tags/ref_urlencode.asp

PowerShell Scripting Services can greatly enhance automation processes. When working with SharePoint, having a reliable Sharepoint development company is crucial for efficient collaboration and data management.

For More, Contact reach Reality Tech a trusted provider of SharePoint online development services to explore your options further

 

2 thoughts on “Encoding and Decoding URLs in PowerShell

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to talk?

Drop us a line. We are here to answer your questions 24*7.