From ff773bd843924e73de1d1d0156b1839335ec391e Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Fri, 15 May 2020 15:37:51 -0700 Subject: [PATCH] Ignore error output from `Get-Process` - allow FinishDumpCollectionForHangingBuilds.ps1 to complete w/o writing to `stderr` --- eng/scripts/StartDumpCollectionForHangingBuilds.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/scripts/StartDumpCollectionForHangingBuilds.ps1 b/eng/scripts/StartDumpCollectionForHangingBuilds.ps1 index 3fd2664d48..206c1454f7 100644 --- a/eng/scripts/StartDumpCollectionForHangingBuilds.ps1 +++ b/eng/scripts/StartDumpCollectionForHangingBuilds.ps1 @@ -81,7 +81,7 @@ Out-File -FilePath $sentinelFile -InputObject $JobName | Out-Null; [System.Diagnostics.Process []]$AliveProcesses = @(); foreach ($candidate in $CandidateProcessNames) { try { - $candidateProcesses = Get-Process $candidate; + $candidateProcesses = Get-Process $candidate 2>$null $candidateProcesses | ForEach-Object { Write-Output "Found candidate process $candidate with PID '$($_.Id)'." }; $AliveProcesses += $candidateProcesses; }