From 15f134a85a3fbfed9161d5f5e71eb6ce03dd4ddf Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov <47745270+al-cheb@users.noreply.github.com> Date: Mon, 19 Sep 2022 17:44:38 +0200 Subject: [PATCH] Exclude Windows Defender update checking (#6259) --- images/win/scripts/Installers/Wait-WindowsUpdatesForInstall.ps1 | 2 +- images/win/scripts/Tests/WindowsFeatures.Tests.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/images/win/scripts/Installers/Wait-WindowsUpdatesForInstall.ps1 b/images/win/scripts/Installers/Wait-WindowsUpdatesForInstall.ps1 index 2039e9396..912f884c9 100644 --- a/images/win/scripts/Installers/Wait-WindowsUpdatesForInstall.ps1 +++ b/images/win/scripts/Installers/Wait-WindowsUpdatesForInstall.ps1 @@ -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" diff --git a/images/win/scripts/Tests/WindowsFeatures.Tests.ps1 b/images/win/scripts/Tests/WindowsFeatures.Tests.ps1 index 973105396..14b708f96 100644 --- a/images/win/scripts/Tests/WindowsFeatures.Tests.ps1 +++ b/images/win/scripts/Tests/WindowsFeatures.Tests.ps1 @@ -72,7 +72,7 @@ Describe "Windows Updates" { It "" -TestCases $testCases { $expect = "Successful" if ( $Title -match "Microsoft Defender Antivirus" ) { - $expect = "Successful", "Failure" + $expect = "Successful", "Failure", "InProgress" } $Status | Should -BeIn $expect