diff --git a/psake.cmd b/psake.cmd index 58b9371..5a0ab44 100644 --- a/psake.cmd +++ b/psake.cmd @@ -4,7 +4,10 @@ if '%1'=='/?' goto help if '%1'=='-help' goto help if '%1'=='-h' goto help -powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\psake.ps1' %*; if ($psake.build_success -eq $false) { exit 1 } else { exit 0 }" +powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\psake.ps1' %*" +if errorlevel 1 ( + exit /b 1 +) goto :eof :help diff --git a/psake.ps1 b/psake.ps1 index 349a8cb..fee8a52 100644 --- a/psake.ps1 +++ b/psake.ps1 @@ -44,3 +44,6 @@ if (-not(test-path $buildFile)) { } invoke-psake $buildFile $taskList $framework $docs $parameters $properties $initialization $nologo +if (-not($psake.build_success)) { + exit 1 +}