[ci]Fail when a step in multiline powershell fails (#35520)

This commit is contained in:
Jaime Bernardo
2024-10-23 08:52:47 +01:00
committed by GitHub
parent 5af2f6f825
commit 04795c6d3a
3 changed files with 10 additions and 2 deletions

View File

@@ -48,7 +48,7 @@ $totalFailure = 0;
Write-Host $DirPath;
if (-not (Test-Path $DirPath)) {
Write-Host "Folder does not exist!"
Write-Error "Folder does not exist!"
}
Write-Host "Total items: " $items.Count
@@ -79,6 +79,7 @@ $items | ForEach-Object {
}
if ($totalFailure -gt 0) {
Write-Error "Some items had issues."
exit 1
}