From f1120574e4a5dccaa82ef472ba36a6b7f4e57ca6 Mon Sep 17 00:00:00 2001 From: Daniel Donenfeld Date: Thu, 14 Feb 2019 14:30:58 -0800 Subject: [PATCH] Fix powershell issue with Foreach-Object --- asm/scripts/deploy-asm.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/asm/scripts/deploy-asm.ps1 b/asm/scripts/deploy-asm.ps1 index 860765f..0019f4c 100644 --- a/asm/scripts/deploy-asm.ps1 +++ b/asm/scripts/deploy-asm.ps1 @@ -47,16 +47,16 @@ function appveyorFinished { [datetime]$stop = ([datetime]::Now).AddMinutes($env:TIMEOUT_MINS) do { - (Get-AppVeyorBuild).build.jobs | Where-Object {$_.jobId -ne $env:APPVEYOR_JOB_ID} | Foreach-Object - -Begin { $anyFalse = $false } - -Progress { + (Get-AppVeyorBuild).build.jobs | Where-Object {$_.jobId -ne $env:APPVEYOR_JOB_ID} | Foreach-Object ` + -Begin { $anyFalse = $false } ` + -Process { $job = $_ switch ($job.status) { "failed" { throw "AppVeyor's Job ($($job.jobId)) failed." } "success" { continue } Default { $anyFalse = $true } } - } + } ` -End { if (!$anyFalse) { return $true } } Start-sleep 5 } while (([datetime]::Now) -lt $stop)