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; }