Skip to content

Ensure Windows helper images builds fail upon error

Stan Hu requested to merge sh-fail-powershell into main

Even though the Invoke-Webrequest command failed in https://gitlab.com/gitlab-org/gitlab-runner/-/jobs/4517690484, the build itself did not fail. This happened because in Powershell 4 and less, a throw will return with an exit code of 0, while in PowerShell 5 and up the exit code defaults to 1.

To avoid this issue, update all throw calls with a function that prints the error and calls exit 1.

Edited by Stan Hu

Merge request reports