SyntaxFix
Write A Post
Hire A Developer
Questions
A verbose equivalent is to combine $LASTEXITCODE and -eq 0:
$LASTEXITCODE
-eq 0
msbuild.exe args; if ($LASTEXITCODE -eq 0) { echo 'it built'; } else { echo 'it failed'; }
I'm not sure why if ($?) didn't work for me, but this one did.
if ($?)