mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-28 04:20:23 +08:00
[Windows] Update helper function that returns Windows Update states (#8878)
This commit is contained in:
committed by
GitHub
parent
12066050d0
commit
e1e621e78c
@@ -62,19 +62,19 @@ Describe "Windows Updates" {
|
||||
"$env:windir\WindowsUpdateDone.txt" | Should -Exist
|
||||
}
|
||||
|
||||
$testCases = Get-WindowsUpdatesHistory | Sort-Object Title | ForEach-Object {
|
||||
$testCases = Get-WindowsUpdateStates | Sort-Object Title | ForEach-Object {
|
||||
@{
|
||||
Title = $_.Title
|
||||
Status = $_.Status
|
||||
Title = $_.Title
|
||||
State = $_.State
|
||||
}
|
||||
}
|
||||
|
||||
It "<Title>" -TestCases $testCases {
|
||||
$expect = "Successful"
|
||||
$expect = "Installed"
|
||||
if ( $Title -match "Microsoft Defender Antivirus" ) {
|
||||
$expect = "Successful", "Failure", "InProgress"
|
||||
$expect = "Installed", "Failed", "Running"
|
||||
}
|
||||
|
||||
$Status | Should -BeIn $expect
|
||||
$State | Should -BeIn $expect
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user