---
type: link
tags: [link]
created: 2025-11-06T02:51:46.19+00:00
updated: 2026-04-06T11:08:37.305929+00:00
---# powershell pwsh —  delete all empty directories from DEFINED-IN-SCRIPT location

**URL:** [https://docs.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-strings?view=powershell-7.1](https://docs.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-strings?view=powershell-7.1)

powershell pwsh | delete all empty directories from DEFINED-IN-SCRIPT location # Recursively list all empty directories and delete them Get-ChildItem -Path xPASTExPATHx -Directory -Recurse | Where-Object { $_.GetFileSystemInfos().Count -eq 0 } | Remove-Item -Force


---
**Keywords:** link
