Does not recognize failed build

Apr 3, 2014 at 12:15 PM
Edited Apr 3, 2014 at 12:18 PM
Very useful module. Had to change a few lines to make it recognize failed builds:
$process = Start-Process cmd.exe -ArgumentList $cmdArgumentsToRunMsBuild -WindowStyle $windowStyle -Wait -PassThru
$buildErrorLevel = $process.ExitCode
and
$buildSucceeded = ((Select-String -Path $buildLogFilePath -Pattern "Build FAILED." -SimpleMatch) -eq $null) -and ($buildErrorLevel -eq 0)
You can't rely on "Build FAILED." being present in the build log, because the people at Microsoft, in their infinite wisdom, decided that "Build FAILED." should be localized to whatever culture the compiler is running in.
Marked as answer by deadlydog on 4/3/2014 at 9:45 AM
Coordinator
Apr 3, 2014 at 4:45 PM
Thanks! I've updated my code to include your solution in version 1.5.