From 11b3e120e254c7640fd9b5343977569fdd9f2149 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Wed, 5 Nov 2025 17:30:53 -0800 Subject: [PATCH] Enhances driver package representation in Get-DellLatestDriverPackages function by adding a human-readable driver name. This change captures the display name from the XML, sanitizes it for display purposes, and ensures proper formatting by collapsing multiple spaces and replacing illegal characters. This improves clarity and usability when displaying driver information. --- FFUDevelopment/FFU.Common/FFU.Common.Drivers.Dell.psm1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/FFUDevelopment/FFU.Common/FFU.Common.Drivers.Dell.psm1 b/FFUDevelopment/FFU.Common/FFU.Common.Drivers.Dell.psm1 index 33a9c21..a96ca37 100644 --- a/FFUDevelopment/FFU.Common/FFU.Common.Drivers.Dell.psm1 +++ b/FFUDevelopment/FFU.Common/FFU.Common.Drivers.Dell.psm1 @@ -188,10 +188,19 @@ function Get-DellLatestDriverPackages { # Build a deterministic sortable key: zero-pad each numeric segment to 6 digits $versionSortable = ($versionArr | ForEach-Object { $_.ToString('D6') }) -join '-' + # Capture a human‑readable driver name (preserve spaces like HP/Lenovo; remove only illegal path chars and extra whitespace) + $displayNode = $comp.SelectSingleNode("*[local-name()='Name']/*[local-name()='Display']") + $nameRaw = if ($displayNode) { $displayNode.InnerText.Trim() } else { $fileName } + # Remove characters not suitable for display (and disallowed in file names) but keep spaces + $nameDisplay = $nameRaw -replace '[\\\/:\*\?\"\<\>\|]', ' ' -replace '[,]', '-' + # Collapse multiple spaces to single + $nameDisplay = ($nameDisplay -replace '\s+', ' ').Trim() + $rawPackages.Add([pscustomobject]@{ Path = $path DownloadUrl = $downloadUrl FileName = $fileName + Name = $nameDisplay Category = $category VendorVersion = $vendorVersion VersionArray = $versionArr @@ -225,6 +234,7 @@ function Get-DellLatestDriverPackages { Path = $pkg.Path DownloadUrl = $pkg.DownloadUrl DriverFileName = $pkg.FileName + Name = $pkg.Name Category = $pkg.Category VendorVersion = $pkg.VendorVersion DateTime = $pkg.DateTime