diff --git a/CI/WindowOSBuild.Tests.ps1 b/CI/WindowOSBuild.Tests.ps1 index e6d7ded..e177727 100644 --- a/CI/WindowOSBuild.Tests.ps1 +++ b/CI/WindowOSBuild.Tests.ps1 @@ -1,6 +1,34 @@ + + BeforeAll { $Path = (Get-Item $PsScriptRoot).parent.FullName + "\WindowsOSBuild.psm1" . Import-Module -Name $Path -Verbose + + # Function to check if a string contains a valid date in YYYY-MM-DD format + Function Find-ValidDate { + Param ( + [string]$InputString + ) + # Trim whitespace from the input string + $InputString = $InputString.Trim() + + # Try to parse the date + Try { + [datetime]::ParseExact($InputString, "yyyy-MM-dd", $null) | Out-Null + Return $true + } + Catch { + Return $false + } + } + + Function Find-TrueOrFalse { + Param ( + [object]$Value + ) + # Return true if the value is either $true or $false + Return $Value -eq $true -or $Value -eq $false + } } If ($PSVersionTable.PSVersion.Major -le 6) { @@ -9,12 +37,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1507 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1507 (RTM) (OS build 10240)' + $Results.Build | Should -Match '^10240\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } $Results.'KB article' | Should -Not -BeNullOrEmpty @@ -26,12 +54,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1511 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1511 (OS build 10586)' + $Results.Build | Should -Match '^10586\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } $Results.'KB article' | Should -Not -BeNullOrEmpty @@ -43,12 +71,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1607 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1607 (OS build 14393)' + $Results.Build | Should -Match '^14393\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } $Results.'KB article' | Should -Not -BeNullOrEmpty @@ -60,12 +88,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1703 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1703 (OS build 15063)' + $Results.Build | Should -Match '^15063\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } $Results.'KB article' | Should -Not -BeNullOrEmpty @@ -77,12 +105,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1709 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1709 (OS build 16299)' + $Results.Build | Should -Match '^16299\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } $Results.'KB article' | Should -Not -BeNullOrEmpty @@ -94,12 +122,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1803 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1803 (OS build 17134)' + $Results.Build | Should -Match '^17134\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } $Results.'KB article' | Should -Not -BeNullOrEmpty @@ -111,12 +139,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1809 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1809 (OS build 17763)' + $Results.Build | Should -Match '^17763\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } $Results.'KB article' | Should -Not -BeNullOrEmpty @@ -128,12 +156,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1903 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1903 (OS build 18362)' + $Results.Build | Should -Match '^18362\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'KB article' | Should -Not -BeNullOrEmpty $Results.'KB URL' | Should -Not -BeNullOrEmpty @@ -144,12 +172,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1909 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1909 (OS build 18363)' + $Results.Build | Should -Match '^18363\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'KB article' | Should -Not -BeNullOrEmpty $Results.'KB URL' | Should -Not -BeNullOrEmpty @@ -160,12 +188,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 2004 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 2004 (OS build 19041)' + $Results.Build | Should -Match '^19041\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'KB article' | Should -Not -BeNullOrEmpty $Results.'KB URL' | Should -Not -BeNullOrEmpty @@ -176,12 +204,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 20H2 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 20H2 (OS build 19042)' + $Results.Build | Should -Match '^19042\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'KB article' | Should -Not -BeNullOrEmpty $Results.'KB URL' | Should -Not -BeNullOrEmpty @@ -192,12 +220,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 21H1 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 21H1 (OS build 19043)' + $Results.Build | Should -Match '^19043\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'KB article' | Should -Not -BeNullOrEmpty $Results.'KB URL' | Should -Not -BeNullOrEmpty @@ -208,12 +236,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 21H2 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 21H2 (OS build 19044)' + $Results.Build | Should -Match '^19044\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } $Results.'KB article' | Should -Not -BeNullOrEmpty @@ -225,12 +253,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 22H2 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 22H2 (OS build 19045)' + $Results.Build | Should -Match '^19045\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'KB article' | Should -Not -BeNullOrEmpty $Results.'KB URL' | Should -Not -BeNullOrEmpty @@ -241,12 +269,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win11 -OSVersion 21H2 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 21H2 (OS build 22000)' + $Results.Build | Should -Match '^22000\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'KB article' | Should -Not -BeNullOrEmpty $Results.'KB URL' | Should -Not -BeNullOrEmpty @@ -257,12 +285,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win11 -OSVersion 22H2 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 22H2 (OS build 22621)' + $Results.Build | Should -Match '^22621\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'KB article' | Should -Not -BeNullOrEmpty $Results.'KB URL' | Should -Not -BeNullOrEmpty @@ -273,12 +301,28 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Win11 -OSVersion 23H2 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 23H2 (OS build 22631)' + $Results.Build | Should -Match '^22631\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } + } + Context "Win 11 (24H2)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win11 -OSVersion 24H2 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 24H2 (OS build 26100)' + $Results.Build | Should -Match '^26100\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'KB article' | Should -Not -BeNullOrEmpty $Results.'KB URL' | Should -Not -BeNullOrEmpty @@ -289,12 +333,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName Server2022 -OSVersion 21H2 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 21H2 (OS build 20348)' + $Results.Build | Should -Match '^20348\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'KB article' | Should -Not -BeNullOrEmpty $Results.'KB URL' | Should -Not -BeNullOrEmpty @@ -306,8 +350,8 @@ If ($PSVersionTable.PSVersion.Major -le 6) { $Results = Get-LatestOSBuild -OSName Server2022Hotpatch -OSVersion 21H2 -latestreleases 1000 Start-Sleep -Seconds 0 $Results.Build.Count | Should -BeGreaterThan 0 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty + $Results.Version | Should -Contain 'Version 21H2 (OS build 20348)' + $Results.Build | Should -Match '^20348\.' $Results.'Availability date' | Should -Not -BeNullOrEmpty $Results.Hotpatch | Should -Not -BeNullOrEmpty $Results.Preview | Should -Not -BeNullOrEmpty @@ -322,12 +366,12 @@ If ($PSVersionTable.PSVersion.Major -le 6) { It "Results" { $Results = Get-LatestOSBuild -OSName ServerSAC -OSVersion 1709 -latestreleases 1000 Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1709 (OS build 16299)' + $Results.Build | Should -Match '^16299\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'KB article' | Should -Not -BeNullOrEmpty $Results.'KB URL' | Should -Not -BeNullOrEmpty @@ -350,9 +394,9 @@ If ($PSVersionTable.PSVersion.Major -le 6) { $Results.Build.Count | Should -Be 1 $Results.Version | Should -Not -BeNullOrEmpty $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'KB article' | Should -Not -BeNullOrEmpty $Results.'KB URL' | Should -Not -BeNullOrEmpty @@ -423,333 +467,351 @@ If ($PSVersionTable.PSVersion.Major -le 6) { } Else { Describe "PWSH - Get-LatestOSBuild" { - Context "Win 10 (1507)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1507 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Describe "PS - Get-LatestOSBuild" { + Context "Win 10 (1507)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1507 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1507 (RTM) (OS build 10240)' + $Results.Build | Should -Match '^10240\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 10 (1511)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1511 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 10 (1511)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1511 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1511 (OS build 10586)' + $Results.Build | Should -Match '^10586\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 10 / Server 2016 (1607)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1607 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 10 / Server 2016 (1607)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1607 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1607 (OS build 14393)' + $Results.Build | Should -Match '^14393\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 10 (1703)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1703 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 10 (1703)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1703 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1703 (OS build 15063)' + $Results.Build | Should -Match '^15063\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 10 (1709)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1709 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 10 (1709)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1709 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1709 (OS build 16299)' + $Results.Build | Should -Match '^16299\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 10 (1803)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1803 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 10 (1803)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1803 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1803 (OS build 17134)' + $Results.Build | Should -Match '^17134\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 10 / Server 2019 (1809)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1809 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 10 / Server 2019 (1809)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1809 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1809 (OS build 17763)' + $Results.Build | Should -Match '^17763\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 10 (1903)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1903 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 10 (1903)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1903 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1903 (OS build 18362)' + $Results.Build | Should -Match '^18362\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 10 (1909)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1909 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 10 (1909)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 1909 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1909 (OS build 18363)' + $Results.Build | Should -Match '^18363\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 10 (2004)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 2004 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 10 (2004)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 2004 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 2004 (OS build 19041)' + $Results.Build | Should -Match '^19041\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 10 (20H2)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 20H2 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 10 (20H2)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 20H2 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 20H2 (OS build 19042)' + $Results.Build | Should -Match '^19042\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 10 (21H1)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 21H1 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 10 (21H1)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 21H1 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 21H1 (OS build 19043)' + $Results.Build | Should -Match '^19043\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 10 (21H2)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 21H2 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 10 (21H2)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 21H2 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 21H2 (OS build 19044)' + $Results.Build | Should -Match '^19044\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'Servicing option' | ForEach-Object { $_ -match "•|\u2022" } | Where-Object { $_ -eq $true } + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 10 (22H2)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 22H2 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 10 (22H2)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win10 -OSVersion 22H2 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 22H2 (OS build 19045)' + $Results.Build | Should -Match '^19045\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 11 (21H2)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win11 -OSVersion 21H2 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 11 (21H2)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win11 -OSVersion 21H2 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 21H2 (OS build 22000)' + $Results.Build | Should -Match '^22000\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 11 (22H2)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win11 -OSVersion 22H2 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 11 (22H2)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win11 -OSVersion 22H2 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 22H2 (OS build 22621)' + $Results.Build | Should -Match '^22621\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Win 11 (23H2)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Win11 -OSVersion 23H2 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 11 (23H2)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win11 -OSVersion 23H2 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 23H2 (OS build 22631)' + $Results.Build | Should -Match '^22631\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Server 2022 (21H2)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Server2022 -OSVersion 21H2 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Win 11 (24H2)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Win11 -OSVersion 24H2 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 24H2 (OS build 26100)' + $Results.Build | Should -Match '^26100\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Server 2022 Hotpatch (21H2)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName Server2022Hotpatch -OSVersion 21H2 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 0 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Hotpatch | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Server 2022 (21H2)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Server2022 -OSVersion 21H2 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 21H2 (OS build 20348)' + $Results.Build | Should -Match '^20348\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } - } - Context "Server SAC (1709)" { - It "Results" { - $Results = Get-LatestOSBuild -OSName ServerSAC -OSVersion 1709 -latestreleases 1000 - Start-Sleep -Seconds 0 - $Results.Build.Count | Should -BeGreaterThan 1 - $Results.Version | Should -Not -BeNullOrEmpty - $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty - $Results.'Servicing option' | Should -Not -BeNullOrEmpty - $Results.'KB article' | Should -Not -BeNullOrEmpty - $Results.'KB URL' | Should -Not -BeNullOrEmpty - $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + Context "Server 2022 Hotpatch (21H2)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName Server2022Hotpatch -OSVersion 21H2 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 21H2 (OS build 20348)' + $Results.Build | Should -Match '^20348\.' + $Results.'Availability date' | Should -Not -BeNullOrEmpty + $Results.Hotpatch | Should -Not -BeNullOrEmpty + $Results.Preview | Should -Not -BeNullOrEmpty + $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } + } + Context "Server SAC (1709)" { + It "Results" { + $Results = Get-LatestOSBuild -OSName ServerSAC -OSVersion 1709 -latestreleases 1000 + Start-Sleep -Seconds 0 + $Results.Build.Count | Should -BeGreaterThan 0 + $Results.Version | Should -Contain 'Version 1709 (OS build 16299)' + $Results.Build | Should -Match '^16299\.' + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Servicing option' | Should -Not -BeNullOrEmpty + $Results.'KB article' | Should -Not -BeNullOrEmpty + $Results.'KB URL' | Should -Not -BeNullOrEmpty + $Results.'Catalog URL' | Should -Not -BeNullOrEmpty + } } } } @@ -769,9 +831,9 @@ Else { $Results.Build.Count | Should -Be 1 $Results.Version | Should -Not -BeNullOrEmpty $Results.Build | Should -Not -BeNullOrEmpty - $Results.'Availability date' | Should -Not -BeNullOrEmpty - $Results.Preview | Should -Not -BeNullOrEmpty - $Results.'Out-of-band' | Should -Not -BeNullOrEmpty + $Results.'Availability date' | ForEach-Object { Find-ValidDate $_ } | Where-Object { $_ -eq $true } + $Results.Preview | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } + $Results.'Out-of-band' | ForEach-Object { Find-TrueOrFalse $_ } | Where-Object { $_ -eq $true } $Results.'Servicing option' | Should -Not -BeNullOrEmpty $Results.'KB article' | Should -Not -BeNullOrEmpty $Results.'KB URL' | Should -Not -BeNullOrEmpty @@ -843,8 +905,8 @@ Else { # SIG # Begin signature block # MIImcgYJKoZIhvcNAQcCoIImYzCCJl8CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR -# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUpxBl7mYJMJaIsIcIMKzO8fgb -# RQiggiAtMIIFjTCCBHWgAwIBAgIQDpsYjvnQLefv21DiCEAYWjANBgkqhkiG9w0B +# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUU1j78O3gDTLJGdllIKvb9EQu +# /mmggiAtMIIFjTCCBHWgAwIBAgIQDpsYjvnQLefv21DiCEAYWjANBgkqhkiG9w0B # AQwFADBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYD # VQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVk # IElEIFJvb3QgQ0EwHhcNMjIwODAxMDAwMDAwWhcNMzExMTA5MjM1OTU5WjBiMQsw @@ -1020,31 +1082,31 @@ Else { # QS4xJDAiBgNVBAMTG0NlcnR1bSBDb2RlIFNpZ25pbmcgMjAyMSBDQQIQeAuTgzem # d0ILREkKU+Yq2jAJBgUrDgMCGgUAoHgwGAYKKwYBBAGCNwIBDDEKMAigAoAAoQKA # ADA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l9lls+Ugq3fI6a50+dGadLO93euweLsEMXnJptUHEDbS +# C8w01Z/apx5oodr6qrdhbMI/Z9GORyYO3JPsLo+G3Zs+ou0gtrqY8hOje8quLs/K +# xRX4iFoq # SIG # End signature block diff --git a/Public/Get-CurrentOSBuild.ps1 b/Public/Get-CurrentOSBuild.ps1 index 19da9dc..254c066 100644 --- a/Public/Get-CurrentOSBuild.ps1 +++ b/Public/Get-CurrentOSBuild.ps1 @@ -61,12 +61,10 @@ ElseIf ($GetOSCaption -match "Server 2019") { $DetectedOS = "Server2019" } - ElseIf ($GetOSCaption -match "Server 2022") { - $DetectedOS = "Server2022" - } ElseIf ($GetOSCaption -match "Server 2022") { If (Get-HotFix -Id KB5003508 -ErrorAction SilentlyContinue) { $DetectedOS = "Server2022Hotpatch" + $FallBackOS = "Server2022" } Else { $DetectedOS = "Server2022" @@ -79,7 +77,19 @@ Throw "Get-CurrentOSBuild: Unable to detect operating system. OS Caption: $GetOSCaption, Detected OS: $DetectedOS" } - Get-LatestOSBuild -OSName $DetectedOS -OSversion $(Get-Build) -LatestReleases 1000 | Where-Object -Property Build -eq $CurrentOSBuild + # Hotpatch OS + If ($FallBackOS) { + $Results = Get-LatestOSBuild -OSName $DetectedOS -OSversion $(Get-Build) -LatestReleases 1000 | Where-Object -Property Build -eq $CurrentOSBuild + # Handle Hotpatch capable OS thats is not using hotpatch updates + If (!$Results) { + $Results = Get-LatestOSBuild -OSName $FallBackOS -OSversion $(Get-Build) -LatestReleases 1000 | Where-Object -Property Build -eq $CurrentOSBuild + } + $Results + } + # All other OS + Else { + Get-LatestOSBuild -OSName $DetectedOS -OSversion $(Get-Build) -LatestReleases 1000 | Where-Object -Property Build -eq $CurrentOSBuild + } } Else { Return $CurrentOSBuild @@ -88,8 +98,8 @@ # SIG # Begin signature block # MIImcgYJKoZIhvcNAQcCoIImYzCCJl8CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgID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J0sUiiTELFK771b0bQC +# IrjoMA0GCSqGSIb3DQEBAQUABIICAC8BT4BehE6efJ0l7pTjG4wIMuhqun4qxIU3 +# e3Z2RHITINy87BclN2vVehUeACGfN3Ym5hLVBYdeNcE7oNl9OmcbxvTeUJDfpH3E +# MMsl9mrjqzs++YTGCz8+PlCi5sKk9s5OvoGpI6i4zXtbpahCLN91eWBjr8nQx3ko +# THrXnlOY+7zikm7QkFjCkWPjRnT4xDMX9ZL99A2OFul0M+s3WngASxMANVrJwaWB +# MOKtaynd2nUM3beQDmguWnSe/IIeFPWao8eB/lvkC81vO8m7A5siv+RXu+WEhCS1 +# +lggmdqY9HSgSDbWGsHhe98hS1MP3Fqj+LfCsMpg2N4UYJYeaV4QkvGL3iXPScIY +# wmZxi52Ak+ispTzdYAhxpUpC2+JfVhHyBBCiLZC9oqBjjMFQTo4vN1fZBYkXimP6 +# e2D2b/XV42t4raMoNmMew5jLxtXsmz4pOGgqVtTSUqtpK8LeFVV3U47AFUaiej8I +# 8wJVbj91GX+lEitJRhpnW3u8cKlD9gBok7xg/RcBbP++3Qm2dYDP14lelFtNn0gp +# e3y6akctEzTm2ne9P/KotPf+tDXKGGgHijtVylKhk8wOiT2GVEtbNyOoCXuvzYJi +# xV8SusVncE61N7/YBqr2ta99nrPD0Xw0Iu28VK5/H2z2vMRJ7wkZEo+JxfiEdul8 +# XHic8hTH # SIG # End signature block diff --git a/Public/Get-LatestOSBuild.ps1 b/Public/Get-LatestOSBuild.ps1 index 1a77a89..b4031b6 100644 --- a/Public/Get-LatestOSBuild.ps1 +++ b/Public/Get-LatestOSBuild.ps1 @@ -15,8 +15,9 @@ This parameter is mandatory. OS version number you want to check. Accepted values: Windows Client OS Versions: - CB/CBB/SAC (Semi-Annual Channel) - 1507, 1511, 1607, 1703, 1709, 1803, 1809, 1903, 1909, 2004, 20H2, 21H2, 22H2, 23H2. - LTSB/LTSC (Long-Term Servicing Build/Channel) - 2015 = 1507, 2016 = 1607, 2019 = 1809, 2021 = 21H2. + CB/CBB/SAC (Semi-Annual Channel) - 1507, 1511, 1607, 1703, 1709, 1803, 1809, 1903, 1909, 2004, 20H2, 21H2, 22H2, 23H2, 24H2. + Win 10 LTSB/LTSC (Long-Term Servicing Build/Channel) - 2015 = 1507, 2016 = 1607, 2019 = 1809, 2021 = 21H2. + Win 11 LTSC (Long-Term Servicing Channel) - 2024 = 24H2. Window Server OS Versions: SAC (Semi-Annual Channel) - 1709, 1803, 1809, 1903, 1909, 2004, 20H2. @@ -122,7 +123,8 @@ $AtomFeedUrl = "https://support.microsoft.com/en-us/feed/atom/6ae59d69-36fc-8e4d-23dd-631d98bf74a9" } ElseIf ($OSName -eq "Server2022" -or $OSName -eq "Server2022Hotpatch") { - $HotpatchOS = Get-HotFix -Id KB5003508 -ErrorAction SilentlyContinue + # Disabled automatic detection of hotfix as it is not a reliable method of guaranteeing devices are applying hotpatch updates, non-hotpatch updates can still be applied. + # $HotpatchOS = Get-HotFix -Id KB5003508 -ErrorAction SilentlyContinue if ($HotpatchOS -or ($OSName -eq "Server2022Hotpatch")) { $URL = "https://support.microsoft.com/en-gb/topic/release-notes-for-hotpatch-in-azure-automanage-for-windows-server-2022-4e234525-5bd5-4171-9886-b475dabe0ce8" $AtomFeedUrl = "https://support.microsoft.com/en-us/feed/atom/2d67e9fb-2bd2-6742-08ee-628da707657f" @@ -344,7 +346,7 @@ [PSCustomObject]@{ 'Base' = $OSBase 'Version' = $Version - 'TableNumber'= $ReleaseVersions.IndexOf($Version) + 1 + 'TableNumber'= $ReleaseVersions.IndexOf($Version) + 2 } } # Windows 10 Base OS @@ -505,8 +507,8 @@ # SIG # Begin signature block # MIImcgYJKoZIhvcNAQcCoIImYzCCJl8CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR -# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUKZJipNqf5Faa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PCZRC3DHeTa8 +# LTd3udIrWqgPQ2cyYQneRcNfTf0k9XU7cuO/vnyWPxDoXAkhK6CxOjYE0ewvXNuw +# qHQzCA56eGs60Pne/gqDTEp5TH2aIO9fQLAAHGy3WYgi0t8XCuh76aK92J2nOBut +# wnjnQSycHQP+2AcJ9+IFDWUUaHNlXqaMRtgipetLx4tyki55tMO4q04GmZbhTsa0 +# x1Ij5gZhz/qgYXvDLaOW1Fh9k7jqVyIw9oAY/qZJm1/X9BqplZ22hmVCHPP8/19w +# lQf5LSDsqLMr/IbNYJeb40Ak9AotXxonfik1A41pZNsjmj8gmKag9/CaFZfsU9P8 +# zE9+1j4SQZ00oeoaa164OJ6bTk27CX2n4FgH8LkzGQqlJcXK8Mjb4VqIT+G12Pe4 +# kcZVPfOLR4Os4zwdf4OHJyrQSmkUpUrIjKfRYbCQSHshF/iK0hsCw3P56elG6U5V +# zP8A61xa3Ik6YSLMB0VRjMLaVylY+73USP3kU4IHJAJyyaEFM7yIoM/KbFYAJERp +# XCJ4oFaY0i71BtKcaAe8ODSr5koixNnLn8HQv9Y5iuPLEvaiAXtJVxJzr9NezjMb +# nDXoCCoIgRiNQQCoOvuGIM4QOzK1Wwl+lqojk5sOtLo76HUlcq5XV8m3S/Fr+Hep +# 7whADteo # SIG # End signature block diff --git a/README.md b/README.md index 3c1d6b8..88f3ffd 100644 --- a/README.md +++ b/README.md @@ -44,27 +44,28 @@ Gets windows patch release information (Build, KB Number, Release Date etc) for ### Parameters - OSName - -This parameter is optional. OS name you want to check. Default value is Win10. Supported accepted values: - -| OS Name | Version | -| :---------------------------------------------------| :-------------------------------------------------------------------------------------------- | -| Windows Client OS Names | Win10, Win11. | -| Windows Server OS Names | Server2016, Server2019, Server2022, Server2022Hotpatch, Server Semi-annual = ServerSAC. | + +This parameter is optional. OS name you want to check. Default value is Win10. Supported accepted values: + +| OS Name | Version | +| :---------------------------------------------------| :---------------------------------------------------------------------------------------------- | +| Windows Client OS Names | Win10, Win11. | +| Windows Server OS Names | Server2016, Server2019, Server2022, Server2022Hotpatch, Server Semi-annual = ServerSAC. | - OSVersion This parameter is mandatory. OS version number you want to check. Supported accepted values: -| Windows Client OS | Version | -| :-------------------------------------------------- | :-------------------------------------------------------------------------------------------- | -| CB/CBB/SAC (Semi-Annual Channel) | 1507, 1511, 1607, 1703, 1709, 1803, 1809, 1903, 1909, 2004, 20H2, 21H1, 21H2, 22H2, 23H2. | -| LTSB/LTSC (Long-Term Servicing Build/Channel) | 2015 = 1507, 2016 = 1607, 2019 = 1809, 2021 = 21H2. | +| Windows Client OS | Version | +| :-------------------------------------------------- | :---------------------------------------------------------------------------------------------- | +| CB/CBB/SAC (Semi-Annual Channel) | 1507, 1511, 1607, 1703, 1709, 1803, 1809, 1903, 1909, 2004, 20H2, 21H1, 21H2, 22H2, 23H2, 24H2. | +| Win 10 LTSB/LTSC (Long-Term Servicing Build/Channel)| 2015 = 1507, 2016 = 1607, 2019 = 1809, 2021 = 21H2. | +| Win 11 LTSC (Long-Term Servicing Channel) | 2024 = 24H2. | -| Windows Server OS | Version | -| :-------------------------------------------------- | :-------------------------------------------------------------------------------------------- | -| SAC (Semi-Annual Channel) | 1709, 1803, 1809, 1903, 1909, 2004, 20H2. | -| LTSB/LTSC (Long-Term Servicing Build/Channel) | 2016 = 1607, 2019 = 1809, 2022 = 21H2. | +| Windows Server OS | Version | +| :-------------------------------------------------- | :---------------------------------------------------------------------------------------------- | +| SAC (Semi-Annual Channel) | 1709, 1803, 1809, 1903, 1909, 2004, 20H2. | +| LTSB/LTSC (Long-Term Servicing Build/Channel) | 2016 = 1607, 2019 = 1809, 2022 = 21H2. | - LatestReleases @@ -89,17 +90,17 @@ This parameter is optional. Returns preview release/s only. - OutOfBandOnly This parameter is optional. Returns out-of-band/s only. - + ## Get-CurrentOSBuild Function Gets the currently installed OS Build release information. Supports Windows 10 and Windows Server 2016 onwards. Supports Hotpatch on Windows Server 2022 Azure Edition. Installed OS Build number or detailed information (Version, Build, Availability date, Hotpatch, Preview, Out-of-band, Servicing option, KB article, KB URL and Catalog URL). -### Parameters +### Parameters + + - Detailed - - Detailed - This parameter is optional. Returns detailed information about the installed OS Build. ## Usage @@ -148,7 +149,7 @@ Show only the latest available preview OS build for Windows 10 Version 22H2 in l ```powershell Get-LatestOSBuild -OSName Win10 -OSVersion 22H2 -PreviewOnly -BuildOnly ``` -Show only the latest available out-of-band OS build for for Windows 10 Version 22H2 in list format. +Show only the latest available out-of-band OS build for for Windows 10 Version 22H2 in list format. ```powershell Get-LatestOSBuild -OSName Win10 -OSVersion 22H2 -OutOfBandOnly -BuildOnly ``` @@ -166,7 +167,7 @@ Get-LatestOSBuild -OSName Win10 -OSVersion 22H2 | ConvertTo-Json | Out-File .\Ge ### Get-CurrentOSBuild ```powershell -PS C:\Users\Ashley> Get-CurrentOSBuild +PS C:\Users\Ashley> Get-CurrentOSBuild 19045.3324 ``` diff --git a/WindowsOSBuild.psd1 b/WindowsOSBuild.psd1 index adeb224..f07c884 100644 Binary files a/WindowsOSBuild.psd1 and b/WindowsOSBuild.psd1 differ