Last active
September 4, 2017 23:04
-
-
Save fcmendoza/c436555063d3233b68332a2e46c39197 to your computer and use it in GitHub Desktop.
Powershell script to "hard" rebuild a Visual Studio solution
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
cls | |
ECHO "Hard rebuilding 'Main' solution. Go get some coffee, this is going to take a few minutes ..." | |
$stopWatch = [system.diagnostics.stopwatch]::startNew() | |
ECHO "Cleaning solution ..." | |
devenv C:\Projects\Main.sln /clean | |
ECHO "Deleting remaining contents in bin folders ..." | |
C:\scripts\delete_bin_folders.bat | |
ECHO "Rebuilding solution ..." | |
devenv C:\Projects\Main.sln /rebuild Debug | |
$elapsedTime = [string]::Format("{0:0.0}", $stopWatch.Elapsed.TotalMinutes) | |
Write-Host "Hard rebuilding 'Main' solution done. Operation took" $elapsedTime "minutes. How was your coffee." | |
#Write-Host "This script took" $elapsedTime "minutes to complete." |
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
set folder="C:\Projects\Main\UI\bin" | |
cd /d %folder% | |
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q) | |
set folder="C:\Projects\Main\DataAccess\bin" | |
cd /d %folder% | |
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q) | |
set folder="C:\Projects\Main\Api\bin" | |
cd /d %folder% | |
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment