Created
February 27, 2024 17:36
-
-
Save shashank-shekhar/6142c287d4c5a07c86a2705b602e0389 to your computer and use it in GitHub Desktop.
Visual Studio real clean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$targetFolders = @('bin', 'obj', 'packages') | |
$startPath = "." | |
# Recursively get all directories that match the target folder names, case-sensitively. | |
Get-ChildItem -Path $startPath -Directory -Recurse | Where-Object { | |
$dirName = $_.Name | |
$targetFolders.Contains($dirName) | |
} | ForEach-Object { | |
Write-Host "Deleting $($_.FullName)" | |
Remove-Item $_.FullName -Recurse -Force | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment