Skip to content

Instantly share code, notes, and snippets.

@AdamDempsey
AdamDempsey / gist:fc2f6daf7d93c549c9527702088013d8
Created February 4, 2022 11:44
Windows Server 2019 - Latest Build Numbers
$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