diff --git a/images/windows/scripts/helpers/InstallHelpers.ps1 b/images/windows/scripts/helpers/InstallHelpers.ps1 index 67faade1d2a5..5d6f2b6f023a 100644 --- a/images/windows/scripts/helpers/InstallHelpers.ps1 +++ b/images/windows/scripts/helpers/InstallHelpers.ps1 @@ -462,6 +462,7 @@ function Get-WindowsUpdateStates { [PSCustomObject]@{ State = $state Title = $title + TimeCreated = $event.TimeCreated } } } diff --git a/images/windows/scripts/tests/WindowsFeatures.Tests.ps1 b/images/windows/scripts/tests/WindowsFeatures.Tests.ps1 index 03b56a2108d1..b9f5e6096910 100644 --- a/images/windows/scripts/tests/WindowsFeatures.Tests.ps1 +++ b/images/windows/scripts/tests/WindowsFeatures.Tests.ps1 @@ -66,10 +66,10 @@ Describe "Windows Updates" { "$env:windir\WindowsUpdateDone.txt" | Should -Exist } - $testCases = Get-WindowsUpdateStates | Sort-Object Title | ForEach-Object { + $testCases = Get-WindowsUpdateStates | Sort-Object TimeCreated | Group-Object Title | ForEach-Object { @{ - Title = $_.Title - State = $_.State + Title = $_.Group[-1].Title + State = $_.Group[-1].State } }