mirror of
https://github.com/actions/runner-images.git
synced 2025-12-17 15:20:11 +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 {
|
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"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user