Created
January 22, 2015 16:09
-
-
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)
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
# 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