Skip to content

Commit 5c943d2

Browse files
committed
(CDPE-7090) Leverage for powershell jobs
I don't completely understand what's going on, but somewhere in our 3-deep powershell script execution, the exit code of the CD4PE job is getting swallowed and turned into 0 every time. This results in a lot of false positives for users running jobs on windows agents. By adding this exit statement, pdk test unit, for example, will exit 1 when tests fail now. Rejoice.
1 parent 67b4488 commit 5c943d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tasks/run_cd4pe_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ def run_with_system(manifest_type)
409409

410410
cmd_to_execute = local_job_script
411411
if (@windows_job)
412-
cmd_to_execute = "powershell \"& {&'#{local_job_script}'}\""
412+
cmd_to_execute = "powershell \"& {&'#{local_job_script}';exit $LASTEXITCODE}\""
413413
end
414414

415415
run_system_cmd(cmd_to_execute)

0 commit comments

Comments
 (0)