| I believe the bug was introduced in https://github.com/jenkinsci/durable-task-plugin/pull/71 https://github.com/jenkinsci/durable-task-plugin/commit/e7f0dd5e7c7018b58dac08bfbc49b8037480a282 Consider powershell script "test.ps1" with contents:
Prior to the change, the old method correctly sets the error code to 2:
& powershell -ExecutionPolicy ByPass -File test.ps1
$LASTEXITCODE
2 After the change (durable-task 1.23 and above), the new method incorrectly sets the error code to 1:
& powershell -ExecutionPolicy ByPass -Command "& .\test.ps1"
$LASTEXITCODE
1 This example uses PSVersion 5.1.16299.967 |