未验证 提交 726c2bc0 编写于 作者: S Sam Harwell 提交者: GitHub

Merge pull request #33800 from sharwell/script-cleanup

Execute code through Exec-Command for consistent error handling
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册