[Windows] Add test to validate windows updates installation (#4489)

* Add test to validate windows updates installation

* Add function Get-WindowsUpdatesHistory
This commit is contained in:
Aleksandr Chebotov
2021-11-16 17:14:17 +03:00
committed by GitHub
parent 1b583e05e5
commit df27520b1f
5 changed files with 110 additions and 18 deletions

View File

@@ -56,3 +56,25 @@ Describe "Test Signed Drivers" -Skip:(Test-IsWin16) {
"$(bcdedit)" | Should -Match "testsigning\s+Yes"
}
}
Describe "Windows Updates" {
It "WindowsUpdateDone.txt should exist" {
"$env:windir\WindowsUpdateDone.txt" | Should -Exist
}
$testCases = Get-WindowsUpdatesHistory | Sort-Object Title | ForEach-Object {
@{
Title = $_.Title
Status = $_.Status
}
}
It "<Title>" -TestCases $testCases {
$expect = "Successful"
if ( $Title -match "Microsoft Defender Antivirus" ) {
$expect = "Successful", "Failure"
}
$Status | Should -BeIn $expect
}
}