mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Normalizes model display in Get-DellClientModels to prevent duplicate brand names in output.
This commit is contained in:
@@ -90,7 +90,20 @@ function Get-DellClientModels {
|
|||||||
$pathAttr = $manifestInfo.GetAttribute('path')
|
$pathAttr = $manifestInfo.GetAttribute('path')
|
||||||
if (-not $pathAttr) { continue }
|
if (-not $pathAttr) { continue }
|
||||||
$cabUrl = 'https://downloads.dell.com/' + $pathAttr
|
$cabUrl = 'https://downloads.dell.com/' + $pathAttr
|
||||||
$modelDisplay = "$brandDisplay $modelNumber ($systemId)"
|
# 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ($brandDisplay -and -not $modelNumber) {
|
||||||
|
$prefixedModelNumber = $brandDisplay
|
||||||
|
}
|
||||||
|
$modelDisplay = "$prefixedModelNumber ($systemId)"
|
||||||
$models.Add([pscustomobject]@{
|
$models.Add([pscustomobject]@{
|
||||||
Brand = $brandDisplay
|
Brand = $brandDisplay
|
||||||
ModelNumber = $modelNumber
|
ModelNumber = $modelNumber
|
||||||
|
|||||||
Reference in New Issue
Block a user