Recursively Delete a Specific Folder

Posted by M. Serdar Karaman on September 11, 2022 · 1 min read

Following powershell script can be used for deleting all Debug folders inside of your project space.

Write-Output "Removing Debug folders" ; 
Get-ChildItem . -include Debug -Recurse | ForEach-Object ($_) { 
    Write-Host "Removed: " -nonewline; 
    Write-Output $_.FullName ; 
    Remove-Item $_.FullName -Force -Recurse 
}