Skip to content

Instantly share code, notes, and snippets.

@Tjerbor
Tjerbor / Delete-empty-folders-recursively-ignore-types.ps1
Last active September 29, 2025 01:50
Powershell script to delete empty folders recursively while ignoring specific file types
# Used for deleting folders to the Recycling Bin.
Add-Type -AssemblyName Microsoft.VisualBasic
# File types to ignore.
$excluded = @(".txt", ".ini")
# Recursive deletion function
function Delete-Folders-Recursively {
param (