mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Optimize driver download by checking for existing WIM files
Refactors the driver download logic for all manufacturers to first check for the existence of a final `.wim` archive. If a WIM file is found, the download and processing for that model is skipped, significantly improving performance on subsequent runs. This change also resolves a potential type conversion error when processing driver mapping JSON files and corrects a minor typo in a log message.
This commit is contained in:
@@ -116,7 +116,10 @@ function Update-DriverMappingJson {
|
||||
$existingJson = Get-Content -Path $mappingFilePath -Raw | ConvertFrom-Json
|
||||
# Ensure it's a collection before adding to the list
|
||||
if ($existingJson -is [array]) {
|
||||
$mappingList.AddRange($existingJson)
|
||||
# Iterate through the array to avoid type conversion issues with AddRange
|
||||
foreach ($item in $existingJson) {
|
||||
$mappingList.Add($item)
|
||||
}
|
||||
}
|
||||
else {
|
||||
$mappingList.Add($existingJson)
|
||||
|
||||
Reference in New Issue
Block a user