From 67f9c770693156bdb5953ac70991b85cca698dec Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Fri, 1 Mar 2019 14:18:36 -0600 Subject: [PATCH] Execute code through Exec-Command for consistent error handling --- eng/build.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/build.ps1 b/eng/build.ps1 index 9a346142d130f..82522278aee0d 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -525,22 +525,22 @@ try { if ($quserItems[1] -eq 'console') { Write-Host "Disconnecting from console before attempting reconnection" try { - tsdiscon + Exec-Command tsdiscon } catch { # ignore } # Disconnection is asynchronous, so wait a few seconds for it to complete Start-Sleep -Seconds 3 - query user + Exec-Command query user } Write-Host "tscon $sessionid /dest:console" - tscon $sessionid /dest:console + Exec-Command tscon $sessionid /dest:console # Connection is asynchronous, so wait a few seconds for it to complete Start-Sleep 3 - query user + Exec-Command query user # Make sure we can capture a screenshot. An exception at this point will fail-fast the build. Capture-Screenshot $screenshotPath