198,176 total views, 13 views today
Encode and decode an URL using PowerShell – here in this post, I will show how to encode and decode the URL using PowerShell coding, and also we will learn how to decode a SharePoint list id (GUID) using the online tool.
Introduction: Encode and decode an URL using PowerShell coding
A website’s URL, also usually known as the “website address”, is what we would enter into a web browser in order to access a specific website’s resource.
and a URL (Uniform Resource Locator) is the unique address to access any resource on the world wide web. URLs have a well-defined structure and are unique which was invented in RFC 1738 by Tim Berners-Lee, the inventor of the world wide web.
URL encoding online (URL encoding PowerShell) – What is the encoded URL?
URL encoding is a technique or mechanism for translating unprintable or special characters to a universally accepted format by web servers and browsers.
The most commonly encoded character in the URL string is the character. We see this character whenever we see a plus-sign (+) in a URL that represents the space character. The plus sign acts as a special character representing that space in a URL.
URL Decode PowerShell – What is the decoded URL?
This is just the reverse process of encoding – translating back the URL to readable English characters.
Encode and decode an URL using PowerShell Script coding
Using the below PowerShell coding we can handle the URL encoding and decoding:
cls Add-Type -AssemblyName System.Web $webURL="https://globalsharepoint.sharepoint.com/sites/TestSite/Shared Documents/" Write-Host "The original url is " $webURL -ForegroundColor Green #The below code is used to encode the URL $urlToEncode = $webURL $encodedURL = [System.Web.HttpUtility]::UrlEncode($urlToEncode) Write-Host "The encoded url is: " $encodedURL -ForegroundColor Green #Encode URL code ends here #The below code is used to decode the URL. $urlTodDecode = $encodedURL $decodedURL = [System.Web.HttpUtility]::UrlDecode($urlTodDecode) Write-Host "The decoded url is: " $decodedURL -ForegroundColor Green #Decode URL code ends here.
Test – Output:
Using online URL encoding and decoding:
There are many open websites using which we can encode and decode the URL, the below URL is one among them.
Using an Online tool decodes a SharePoint List ID (GUID)
This is a great little but a very helpful tool by Eric Meyer. Input a nasty-looking URL string, and it will make it into something that you can read.
If we go to the list edit page, we will get the below nasty URL which is very unformatted and difficult to understand,
Original URL: /_layouts/listedit.aspx?List= %7BAA90DD8B%2DD2B7%2D49E9%2DA8DE%2D9138AB94CA68%7D
If we decode the above URL using this tool, we will get the below friendlier URL.
Decoded URL: /_layouts/listedit.aspx?List ={AA90DD8B-D2B7-49E9-A8DE-9138AB94CA68}
Example:
Tool URL: https://meyerweb.com/eric/tools/dencoder/

Source:
- https://docs.microsoft.com/en-in/archive/blogs/sharepointcomic/url-decoderencoder-guid-converter
- https://meyerweb.com/eric/tools/dencoder/
Summary: Encode and decode an URL using PowerShell script
Thus, in this post we have learned the below concepts:
- How to decode a string.
- How to encode a URL using PowerShell.
- How to decode a URL using PowerShell.
- How to decode URL online.
- How to decode a SharePoint list ID (GUID) online.
References: Encode and decode an URL using PowerShell script
See Also: PowerShell Online tutorial
You may also like the below PowerShell Online tutorials:
- Exception or Error handling in PowerShell -Try/Catch/Finally Block Example
- PowerShell: How to pass multiple parameters into a function in PowerShell
- Using PowerShell create a log file
- Using PowerShell – Create a folder if not exists
- Office 365: Getting started with SharePoint PnP PowerShell – installation
- In 2 steps convert a classic SharePoint page to modern using PnP
- Office 365: Retrieve hub sites and associated sites using PnP Powershell
- Create a modern team site using PnP PowerShell in SharePoint
- In 4 steps access SharePoint online data using postman tool
- SharePoint admin center: Learn SharePoint online administration in an hour – step by step
- SharePoint REST API: GET vs POST vs PUT vs DELETE vs PATCH
- Office 365: Understanding the hub site in SharePoint online
Looking for a PowerApps tutorial from scratch? Then you are in the right place, below are a bunch PowerApps articles you may like:
- How to send email from PowerApps button click?
- How to open outlook from PowerApps step by step?
- Create your first chatbot in PowerApps step by step
- Cascading dropdown in PowerApps using SharePoint data
- CRUD operations in PowerApps using SharePoint online list
- CRUD Operation in PowerApps Using Excel OneDrive
- Phone number and email validation in PowerApps
- Connect to a SharePoint list in PowerApps step by step
- Collection variable in PowerApps
- Understand the difference between Set and UpdateContext function
- String concatenation function in PowerApps
- 3 ways to create Power Apps – Types of Power Apps
- Overview view of PowerApps development environment in Power Platform
- Customize SharePoint List Forms Using PowerApps step by step – Office 365
- Create free development environment using Power Apps Community Plan
- Show or hide columns conditionally in SharePoint list form
- SharePoint Online – Power Automate: How to Export and Import Microsoft Team Flows across environment
Buy the premium version of SharePoint Online & Office 365 administration eBook from here: