Created
October 30, 2015 03:33
-
-
Save RhysC/a0c34ae3101745c1dca1 to your computer and use it in GitHub Desktop.
Make sure that each project can be built from a clean state (ie no rouge dlls from previous builds)
This file contains hidden or 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
$ErrorActionPreference = "Stop" | |
function cleanBin { | |
param ([string]$path) | |
write-host "Cleaning bin from: $path" | |
get-childitem $path -include bin -recurse | remove-item -force -confirm:$false -recurse | |
write-host "Cleaning obj from: $path" | |
get-childitem $path -include obj -recurse | remove-item -force -confirm:$false -recurse | |
write-host "Cleaning csx from: $path" | |
get-childitem $path -include csx -recurse | remove-item -force -confirm:$false -recurse | |
write-host "Cleaning BuildOutput (no recursive search) from: $path" | |
get-childitem $path -include BuildOutput | remove-item -force -confirm:$false -recurse | |
} | |
$msbuild = "C:\\Program Files (x86)\\MSBuild\\12.0\\Bin\\MSBuild.exe" | |
Get-ChildItem *.csproj -Recurse | | |
ForEach-Object { | |
cleanBin | |
& $msbuild $_.Fullname /verbosity:quiet | |
if($lastexitcode){ | |
exit $lastexitcode | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment