From dcb7957d1582ef230e0c800afd9dc1be570f3068 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Fri, 27 Jun 2025 09:34:25 -0700 Subject: [PATCH] Refactor driver handling and remove preview update option Removes the parameter for installing preview cumulative updates to simplify the script's interface. Improves logging during the driver copy process to provide better visibility into which drivers are being used. The UI no longer loads the selected device 'Make' from the configuration on startup. --- FFUDevelopment/BuildFFUVM.ps1 | 19 +++++++++---------- .../FFUUI.Core/FFUUI.Core.Config.psm1 | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/FFUDevelopment/BuildFFUVM.ps1 b/FFUDevelopment/BuildFFUVM.ps1 index 8ac114d..ba42c86 100644 --- a/FFUDevelopment/BuildFFUVM.ps1 +++ b/FFUDevelopment/BuildFFUVM.ps1 @@ -153,9 +153,6 @@ When set to $true, will download and install the latest Microsoft Edge for Windo .PARAMETER UpdateLatestCU When set to $true, will download and install the latest cumulative update for Windows 10/11. Default is $false. -.PARAMETER UpdatePreviewCU -When set to $true, will download and install the latest Preview cumulative update for Windows 10/11. Default is $false. - .PARAMETER UpdateLatestDefender When set to $true, will download and install the latest Windows Defender definitions and Defender platform update. Default is $false. @@ -3346,9 +3343,11 @@ Function New-DeploymentUSB { if ($CopyDrivers) { WriteLog "Copying drivers to $DeployPartitionDriveLetter\Drivers" if ($Make) { + WriteLog "Copying drivers for make: $Make" robocopy "$DriversFolder\$Make" "$DeployPartitionDriveLetter\Drivers" /E /R:5 /W:5 /J } else { + WriteLog "No make specified, copying all drivers" robocopy "$DriversFolder" "$DeployPartitionDriveLetter\Drivers" /E /R:5 /W:5 /J } @@ -4000,10 +3999,10 @@ if ($driversJsonPath -and (Test-Path $driversJsonPath) -and ($InstallDrivers -or if ($resultCode -eq 0 -and -not [string]::IsNullOrWhiteSpace($driverPath)) { # The task was successful and returned a driver path. - $make = $makeLookup[$modelName] - if ($make) { + $makeJson = $makeLookup[$modelName] + if ($makeJson) { $successfullyDownloaded.Add([PSCustomObject]@{ - Make = $make + Make = $makeJson Model = $modelName DriverPath = $driverPath }) @@ -4051,11 +4050,11 @@ if ($driversJsonPath -and (Test-Path $driversJsonPath) -and ($InstallDrivers -or $modelName = if ($result.PSObject.Properties.Name -contains 'Identifier') { $result.Identifier } else { $result.Model } # Find the 'Make' from the original list - $make = $makeLookup[$modelName] - - if ($make) { + $makeJson = $makeLookup[$modelName] + + if ($makeJson) { $successfullyDownloaded.Add([PSCustomObject]@{ - Make = $make + Make = $makeJson Model = $modelName DriverPath = $result.DriverPath }) diff --git a/FFUDevelopment/FFUUI.Core/FFUUI.Core.Config.psm1 b/FFUDevelopment/FFUUI.Core/FFUUI.Core.Config.psm1 index 38be10d..826a06c 100644 --- a/FFUDevelopment/FFUUI.Core/FFUUI.Core.Config.psm1 +++ b/FFUDevelopment/FFUUI.Core/FFUUI.Core.Config.psm1 @@ -351,7 +351,7 @@ function Update-UIFromConfig { Set-UIValue -ControlName 'chkInstallDrivers' -PropertyName 'IsChecked' -ConfigObject $ConfigContent -ConfigKey 'InstallDrivers' -State $State Set-UIValue -ControlName 'chkDownloadDrivers' -PropertyName 'IsChecked' -ConfigObject $ConfigContent -ConfigKey 'DownloadDrivers' -State $State Set-UIValue -ControlName 'chkCopyDrivers' -PropertyName 'IsChecked' -ConfigObject $ConfigContent -ConfigKey 'CopyDrivers' -State $State - Set-UIValue -ControlName 'cmbMake' -PropertyName 'SelectedItem' -ConfigObject $ConfigContent -ConfigKey 'Make' -State $State + # Set-UIValue -ControlName 'cmbMake' -PropertyName 'SelectedItem' -ConfigObject $ConfigContent -ConfigKey 'Make' -State $State Set-UIValue -ControlName 'txtDriversFolder' -PropertyName 'Text' -ConfigObject $ConfigContent -ConfigKey 'DriversFolder' -State $State Set-UIValue -ControlName 'txtPEDriversFolder' -PropertyName 'Text' -ConfigObject $ConfigContent -ConfigKey 'PEDriversFolder' -State $State Set-UIValue -ControlName 'txtDriversJsonPath' -PropertyName 'Text' -ConfigObject $ConfigContent -ConfigKey 'DriversJsonPath' -State $State