Skip to content

Instantly share code, notes, and snippets.

@ktos
Created January 22, 2015 16:09
Show Gist options
  • Save ktos/372c4a4d3cd69a3b128a to your computer and use it in GitHub Desktop.
Save ktos/372c4a4d3cd69a3b128a to your computer and use it in GitHub Desktop.
A small script to remove all files from Visual Studio solution which aren't important for other users (*.suo, *.user, caches, build versions)
# clean-vssolution.ps1
#
# Cleans Visual Studio Solution folder
# removing .suo, .user, build and obj folders
Param ($folder = ".")
$include = @("*.suo", "*.user", "*.cache", "bin", "obj", "build")
$exclude = @()
if ($folder -ne "")
{
Get-ChildItem $folder -Recurse -Force -Include $include -Exclude $exclude | % {
Remove-Item $_.FullName -Force -Recurse -ErrorAction SilentlyContinue
}
}
else
{
Write-Error "Syntax: clean-vssolution <directory>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment