Remove Folder via URL-Encoded Path

This PowerShell script is designed to remove a folder when its path is provided in a URL-encoded format. It can be especially useful in automation pipelines or tools where folder paths are passed as encoded parameters.

Features

📜 Script
param (
    [string]$FolderPath = ""
)

# Unescape the URL-encoded path
$unescapedFolderPath = [Uri]::UnescapeDataString($FolderPath)

if (Test-Path -Path $unescapedFolderPath) {
    Remove-Item -Path $unescapedFolderPath -Recurse -Force
}

This script permanently deletes the folder and its contents. Ensure the path provided is correct and safe to delete.

Ideal for use in cleanup tasks, temp directory deletion, or post-deployment teardown processes.


Revision #3
Created 16 July 2025 22:15:27 by Admin
Updated 16 July 2025 23:13:07 by Admin