Skip to content

Instantly share code, notes, and snippets.

@tcartwright
Last active March 3, 2025 17:57
Show Gist options
  • Save tcartwright/a5aa2561e47a071cbb579672032b5b86 to your computer and use it in GitHub Desktop.
Save tcartwright/a5aa2561e47a071cbb579672032b5b86 to your computer and use it in GitHub Desktop.
POWERSHELL: Clean build artifacts
Clear-Host
$parentDir = $PSScriptRoot
if ($parentDir) {
Write-Host "Cleaning $parentDir" -ForegroundColor Yellow
Get-ChildItem -path $parentDir -Filter "bin" -Recurse -Directory | Remove-Item -Recurse -ErrorAction SilentlyContinue -Verbose
Get-ChildItem -path $parentDir -Filter "obj" -Recurse -Directory | Remove-Item -Recurse -ErrorAction SilentlyContinue -Verbose
} else {
Write-Host "The parent directory is invalid. Please correct before runnning." -ForegroundColor Red
}
Write-Host "Press enter to continue"
$discard = Read-Host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment