Exclude Windows Defender update checking (#6259)

This commit is contained in:
Aleksandr Chebotov
2022-09-19 17:44:38 +02:00
committed by GitHub
parent 3fab712c1e
commit 15f134a85a
2 changed files with 2 additions and 2 deletions

View File

@@ -4,7 +4,7 @@
################################################################################ ################################################################################
Invoke-SBWithRetry -RetryCount 10 -RetryIntervalSeconds 120 -Command { 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 ) { if ( $inProgress ) {
$title = $inProgress.Title -join "`n" $title = $inProgress.Title -join "`n"
throw "InProgress: $title" throw "InProgress: $title"

View File

@@ -72,7 +72,7 @@ Describe "Windows Updates" {
It "<Title>" -TestCases $testCases { It "<Title>" -TestCases $testCases {
$expect = "Successful" $expect = "Successful"
if ( $Title -match "Microsoft Defender Antivirus" ) { if ( $Title -match "Microsoft Defender Antivirus" ) {
$expect = "Successful", "Failure" $expect = "Successful", "Failure", "InProgress"
} }
$Status | Should -BeIn $expect $Status | Should -BeIn $expect