mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 06:08:07 +00:00
Exclude Windows Defender update checking (#6259)
This commit is contained in:
committed by
GitHub
parent
3fab712c1e
commit
15f134a85a
@@ -4,7 +4,7 @@
|
||||
################################################################################
|
||||
|
||||
Invoke-SBWithRetry -RetryCount 10 -RetryIntervalSeconds 120 -Command {
|
||||
$inProgress = Get-WindowsUpdatesHistory | Where-Object Status -eq "InProgress"
|
||||
$inProgress = Get-WindowsUpdatesHistory | Where-Object Status -eq "InProgress" | Where-Object Title -notmatch "Microsoft Defender Antivirus"
|
||||
if ( $inProgress ) {
|
||||
$title = $inProgress.Title -join "`n"
|
||||
throw "InProgress: $title"
|
||||
|
||||
@@ -72,7 +72,7 @@ Describe "Windows Updates" {
|
||||
It "<Title>" -TestCases $testCases {
|
||||
$expect = "Successful"
|
||||
if ( $Title -match "Microsoft Defender Antivirus" ) {
|
||||
$expect = "Successful", "Failure"
|
||||
$expect = "Successful", "Failure", "InProgress"
|
||||
}
|
||||
|
||||
$Status | Should -BeIn $expect
|
||||
|
||||
Reference in New Issue
Block a user