mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-13 18:07:20 -06:00
Adds generic fallback for driver matching
Implements a generic model-based matching strategy for manufacturers without explicit handling rules in the driver mapping logic. Previously, unsupported manufacturers would immediately return null without attempting to match driver rules. Now falls back to comparing normalized model names against available rules, improving driver detection coverage for manufacturers that don't require specialized matching logic. Updates logging to distinguish between successful generic matches and complete failures to find matching drivers.
This commit is contained in:
@@ -657,7 +657,16 @@ function Find-DriverMappingRule {
|
||||
return $null
|
||||
}
|
||||
default {
|
||||
WriteLog "DriverMapping: Automatic matching not implemented for manufacturer '$normalizedManufacturer'."
|
||||
# Generic fallback for manufacturers without explicit handling
|
||||
foreach ($rule in $rulesForMake) {
|
||||
if (-not $rule.PSObject.Properties['Model']) { continue }
|
||||
$ruleModelNorm = ConvertTo-ComparableModelName -Text $rule.Model
|
||||
if (-not [string]::IsNullOrWhiteSpace($ruleModelNorm) -and $ruleModelNorm -eq $normalizedModel) {
|
||||
WriteLog "DriverMapping: Manufacturer '$normalizedManufacturer' model '$normalizedModel' matched '$($rule.Model)'."
|
||||
return $rule
|
||||
}
|
||||
}
|
||||
WriteLog "DriverMapping: No generic match found for manufacturer '$normalizedManufacturer' using model '$normalizedModel'."
|
||||
return $null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user