fix: Microsoft Update Catalog now includes the windows version information in the KB article title. This caused an issue where parsing the KB article was failing. Fixed the regex to accomdate this.

This commit is contained in:
rbalsleyMSFT
2025-08-12 17:30:28 -07:00
parent 78d7bb9262
commit 35f37f3a36
+2 -2
View File
@@ -2069,7 +2069,7 @@ function Get-KBLink {
# Extract the first KB article ID from the HTML content and store it globally # Extract the first KB article ID from the HTML content and store it globally
# Edge and Defender do not have KB article IDs # Edge and Defender do not have KB article IDs
if ($Name -notmatch 'Defender|Edge') { if ($Name -notmatch 'Defender|Edge') {
if ($results.Content -match '>\s*([^\(<]+)\(KB(\d+)\)\s*<') { if ($results.Content -match '>\s*([^\(<]+)\(KB(\d+)\)(?:\s*\([^)]+\))*\s*<') {
$kbArticleID = "KB$($matches[2])" $kbArticleID = "KB$($matches[2])"
$global:LastKBArticleID = $kbArticleID $global:LastKBArticleID = $kbArticleID
WriteLog "Found KB article ID: $kbArticleID" WriteLog "Found KB article ID: $kbArticleID"
@@ -3882,7 +3882,7 @@ function Remove-InProgressItems {
$remainder = $fullTarget.Substring($driversRoot.Length).TrimStart('\') $remainder = $fullTarget.Substring($driversRoot.Length).TrimStart('\')
$parts = $remainder -split '\\' $parts = $remainder -split '\\'
if ($parts.Length -ge 1) { if ($parts.Length -ge 1) {
$knownMakes = @('Dell','HP','Lenovo','Microsoft') $knownMakes = @('Dell', 'HP', 'Lenovo', 'Microsoft')
if ($parts.Length -ge 2 -and $knownMakes -contains $parts[0]) { if ($parts.Length -ge 2 -and $knownMakes -contains $parts[0]) {
# Drivers\<Make>\<Model>\... # Drivers\<Make>\<Model>\...
$modelFolder = Join-Path (Join-Path $driversRoot $parts[0]) $parts[1] $modelFolder = Join-Path (Join-Path $driversRoot $parts[0]) $parts[1]