Skip to content

Commit

Permalink
Execute code through Exec-Command for consistent error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Mar 2, 2019
1 parent 0486466 commit 67f9c77
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 67f9c77

Please sign in to comment.