Skip to content

Instantly share code, notes, and snippets.

@pulimento
Created January 29, 2020 09:08
Show Gist options
  • Save pulimento/8bfecb74f31f492fa15bdc133acfb5a8 to your computer and use it in GitHub Desktop.
Save pulimento/8bfecb74f31f492fa15bdc133acfb5a8 to your computer and use it in GitHub Desktop.
Clear VS project folder
# Define files and directories to delete
$include = @("*.suo","*.user","*.cache","*.docstates","bin","obj","*.GhostDoc.xml")
# Define files and directories to exclude
$exclude = @()
$items = Get-ChildItem . -recurse -force -include $include -exclude $exclude
if ($items) {
foreach ($item in $items) {
Remove-Item $item.FullName -Force -Recurse -ErrorAction SilentlyContinue
Write-Host "Deleted" $item.FullName
}
}
Write-Host "Press any key to continue . . ."
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment