Forked from RhysC/BuildAllProjectsFromACleanState.ps1
Created
November 5, 2015 02:42
-
-
Save afifmohammed/31d3dff0151bbda8e981 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 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