mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Improves Surface driver matching via System SKU
Adds best-effort Surface System SKU resolution and persists it into driver mappings to reduce model-name ambiguity during deployment. Speeds up Microsoft model discovery by using a local cache and updates cached Download Center details during driver downloads to keep the UI responsive. Prefers System SKU-based rule selection for Microsoft devices, falling back to legacy model-string matching when SKU data is unavailable.
This commit is contained in:
@@ -558,6 +558,21 @@ function Find-DriverMappingRule {
|
||||
return $null
|
||||
}
|
||||
'Microsoft' {
|
||||
# Prefer System SKU matching for Microsoft/Surface when available.
|
||||
if (-not [string]::IsNullOrWhiteSpace($systemSkuNormalized)) {
|
||||
foreach ($rule in $rulesForMake) {
|
||||
if ($rule.PSObject.Properties['SystemSku'] -and $null -ne $rule.SystemSku) {
|
||||
foreach ($sku in @($rule.SystemSku)) {
|
||||
if (-not [string]::IsNullOrWhiteSpace($sku) -and $sku.Trim().ToUpperInvariant() -eq $systemSkuNormalized) {
|
||||
WriteLog "DriverMapping: Microsoft SystemSku '$systemSkuNormalized' matched '$($rule.Model)'."
|
||||
return $rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Fallback to model string comparison (legacy behavior).
|
||||
foreach ($rule in $rulesForMake) {
|
||||
$ruleModelNorm = ConvertTo-ComparableModelName -Text $rule.Model
|
||||
if (-not [string]::IsNullOrWhiteSpace($ruleModelNorm) -and $ruleModelNorm -eq $normalizedModel) {
|
||||
|
||||
Reference in New Issue
Block a user