mirror of
https://github.com/actions/runner-images.git
synced 2025-12-12 20:26:49 +00:00
[windows] Update Get-WindowsUpdateStates function (#11397)
This commit is contained in:
committed by
GitHub
parent
af0df29967
commit
ee530b00e3
@@ -438,13 +438,15 @@ function Get-WindowsUpdateStates {
|
|||||||
19 {
|
19 {
|
||||||
$state = "Installed"
|
$state = "Installed"
|
||||||
$title = $event.Properties[0].Value
|
$title = $event.Properties[0].Value
|
||||||
$completedUpdates[$title] = ""
|
$completedUpdates[$title] = $state
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
20 {
|
20 {
|
||||||
$state = "Failed"
|
$state = "Failed"
|
||||||
$title = $event.Properties[1].Value
|
$title = $event.Properties[1].Value
|
||||||
$completedUpdates[$title] = ""
|
if (-not $completedUpdates.ContainsKey($title)) {
|
||||||
|
$completedUpdates[$title] = $state
|
||||||
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
43 {
|
43 {
|
||||||
@@ -454,8 +456,13 @@ function Get-WindowsUpdateStates {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Skip update started event if it was already completed
|
# Skip Running update event if it was already completed
|
||||||
if ( $state -eq "Running" -and $completedUpdates.ContainsKey($title) ) {
|
if ( ($state -eq "Running") -and $completedUpdates.ContainsKey($title) ) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
# Skip Failed update event if it was already successfully installed
|
||||||
|
if ( ($state -eq "Failed") -and $completedUpdates[$title] -eq "Installed" ) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user