Encoding and Decoding URLs in PowerShell

39

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:

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

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

Share this entry

2 Responses

Leave a Reply

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

Table of Contents

Categories

Categories