Created
February 4, 2022 11:44
-
-
Save AdamDempsey/fc2f6daf7d93c549c9527702088013d8 to your computer and use it in GitHub Desktop.
Windows Server 2019 - Latest Build Numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$request = Invoke-WebRequest "https://support.microsoft.com/en-gb/help/4464619" –UseBasicParsing | |
If ($request.StatusCode -eq 200) { | |
$Matches = [regex]::Matches($request.Content, 'href="([a-z0-9-\/]*)">([a-zA-Z]*) ([0-9]{1,2}), ([0-9]{4}).*?(KB[0-9]*) \(OS Build 17763.([0-9]*)\)(?: ([a-zA-Z-]*)<\/a>)?') | |
if ($Matches.Count -gt 0) { | |
$LatestServer2019Raw = [PSCustomObject]@{ | |
'OS build' = $Matches[0].Groups[6].Value | |
'Date' = "$($Matches[0].Groups[3].Value) $($Matches[0].Groups[2].Value) $($Matches[0].Groups[4].Value)" | |
'URL' = "https://support.microsoft.com$($Matches[0].Groups[1].Value)" | |
'KB' = $Matches[0].Groups[5].Value | |
'Info' = $Matches[0].Groups[7].Value | |
} | |
$PreviousServer2019Raw = [PSCustomObject]@{ | |
'OS build' = $($Matches[1].Groups[6].Value) | |
'Date' = "$($Matches[1].Groups[3].Value) $($Matches[1].Groups[2].Value) $($Matches[1].Groups[4].Value)" | |
'URL' = "https://support.microsoft.com$($Matches[1].Groups[1].Value)" | |
'KB' = $Matches[1].Groups[5].Value | |
'Info' = $Matches[1].Groups[7].Value | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment