[Windows] Add pause after Windows Update (#4641)

This commit is contained in:
Aleksandr Chebotov
2021-12-02 10:56:43 +03:00
committed by GitHub
parent d0f20ddfa3
commit c50afe27cd
4 changed files with 22 additions and 5 deletions

View File

@@ -0,0 +1,12 @@
################################################################################
## File: Wait-WindowsUpdatesForInstall.ps1
## Desc: Wait for installation windows updates to complete
################################################################################
Invoke-SBWithRetry -RetryCount 10 -RetryIntervalSeconds 120 -Command {
$inProgress = Get-WindowsUpdatesHistory | Where-Object Status -eq "InProgress"
if ( $inProgress ) {
$title = $inProgress.Title -join "`n"
throw "InProgress: $title"
}
}