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:
rbalsleyMSFT
2025-11-17 18:24:49 -08:00
parent 93c4679c46
commit beb48e500e
@@ -657,7 +657,16 @@ function Find-DriverMappingRule {
return $null return $null
} }
default { 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 return $null
} }
} }