From 667edf372407fd8dd35858f9e62fb31fb362a580 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Wed, 5 Nov 2025 15:33:15 -0800 Subject: [PATCH] Normalizes model display in Get-DellClientModels function by utilizing GroupManifest Display CDATA when available. Implements fallback logic to construct model names from brand and model nodes, improving clarity and consistency in model representation. --- .../FFU.Common/FFU.Common.Drivers.Dell.psm1 | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/FFUDevelopment/FFU.Common/FFU.Common.Drivers.Dell.psm1 b/FFUDevelopment/FFU.Common/FFU.Common.Drivers.Dell.psm1 index 2e9284b..33a9c21 100644 --- a/FFUDevelopment/FFU.Common/FFU.Common.Drivers.Dell.psm1 +++ b/FFUDevelopment/FFU.Common/FFU.Common.Drivers.Dell.psm1 @@ -90,20 +90,30 @@ function Get-DellClientModels { $pathAttr = $manifestInfo.GetAttribute('path') if (-not $pathAttr) { continue } $cabUrl = 'https://downloads.dell.com/' + $pathAttr - # Normalize model display to avoid duplicate brand (e.g. Latitude Latitude 13 (0432)) - $prefixedModelNumber = $modelNumber - if ($modelNumber -and $brandDisplay) { - if ($modelNumber.StartsWith($brandDisplay,[System.StringComparison]::OrdinalIgnoreCase)) { - $prefixedModelNumber = $modelNumber - } - else { - $prefixedModelNumber = "$brandDisplay $modelNumber" - } + # Normalize model display using GroupManifest Display CDATA if available (strip 'PDK Catalog for') + $gmDisplayNode = $doc.SelectSingleNode("/*[local-name()='GroupManifest']/*[local-name()='Display']") + $modelFull = $null + if ($gmDisplayNode -and $gmDisplayNode.InnerText) { + $rawDisplay = $gmDisplayNode.InnerText.Trim() + $modelFull = ($rawDisplay -replace '^\s*PDK Catalog for\s+','').Trim() } - elseif ($brandDisplay -and -not $modelNumber) { - $prefixedModelNumber = $brandDisplay + if ([string]::IsNullOrWhiteSpace($modelFull)) { + # Fallback: assemble from brand/model nodes (legacy heuristic) + $prefixedModelNumber = $modelNumber + if ($modelNumber -and $brandDisplay) { + if ($modelNumber.StartsWith($brandDisplay,[System.StringComparison]::OrdinalIgnoreCase)) { + $prefixedModelNumber = $modelNumber + } + else { + $prefixedModelNumber = "$brandDisplay $modelNumber" + } + } + elseif ($brandDisplay -and -not $modelNumber) { + $prefixedModelNumber = $brandDisplay + } + $modelFull = $prefixedModelNumber } - $modelDisplay = "$prefixedModelNumber ($systemId)" + $modelDisplay = "$modelFull ($systemId)" $models.Add([pscustomobject]@{ Brand = $brandDisplay ModelNumber = $modelNumber