diff --git a/hack/ci/windows.ps1 b/hack/ci/windows.ps1 index 28a7f7860e..faaad162d8 100644 --- a/hack/ci/windows.ps1 +++ b/hack/ci/windows.ps1 @@ -960,6 +960,9 @@ Catch [Exception] { Throw $_ } Finally { + # Preserve the LastExitCode of the tests + $tmpLastExitCode = $LastExitCode + $ErrorActionPreference="SilentlyContinue" $global:ProgressPreference=$origProgressPreference Write-Host -ForegroundColor Green "INFO: Tidying up at end of run" @@ -993,4 +996,6 @@ Finally { Nuke-Everything $Dur=New-TimeSpan -Start $StartTime -End $(Get-Date) Write-Host -ForegroundColor $FinallyColour "`nINFO: executeCI.ps1 exiting at $(date). Duration $dur`n" + + exit $tmpLastExitCode }