[Windows] Update helper function that returns Windows Update states (#8878)

This commit is contained in:
Vasilii Polikarpov
2023-11-27 12:29:42 +01:00
committed by GitHub
parent 12066050d0
commit e1e621e78c
5 changed files with 49 additions and 29 deletions

View File

@@ -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
}
}