mirror of
https://github.com/actions/runner-images.git
synced 2026-01-09 12:08:02 +08:00
[Windows] Update helper function that returns Windows Update states (#8878)
This commit is contained in:
committed by
GitHub
parent
12066050d0
commit
e1e621e78c
@@ -4,9 +4,9 @@
|
||||
################################################################################
|
||||
|
||||
Invoke-SBWithRetry -RetryCount 10 -RetryIntervalSeconds 120 -Command {
|
||||
$inProgress = Get-WindowsUpdatesHistory | Where-Object Status -eq "InProgress" | Where-Object Title -notmatch "Microsoft Defender Antivirus"
|
||||
$inProgress = Get-WindowsUpdateStates | Where-Object State -eq "Running" | Where-Object Title -notmatch "Microsoft Defender Antivirus"
|
||||
if ( $inProgress ) {
|
||||
$title = $inProgress.Title -join "`n"
|
||||
throw "InProgress: $title"
|
||||
throw "Windows updates are still installing: $title"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user