From e076e9f4cae0ed3fbbb99f6f53a078b6f49fa91a Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Wed, 19 Nov 2025 23:58:29 -0800 Subject: [PATCH] Add option to skip driver installation during deployment Allows users to bypass driver installation by entering 0 at the selection prompt, providing flexibility for deployments that don't require driver updates. Introduces a skip flag and restructures the selection validation logic to accept either a valid driver selection or a skip command. When skipped, driver-related variables are set to null and appropriate logging messages are generated. --- .../WinPEDeployFFUFiles/ApplyFFU.ps1 | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 b/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 index 5da5222..a39b7dd 100644 --- a/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 +++ b/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 @@ -1298,23 +1298,38 @@ if ($null -eq $DriverSourcePath) { } $displayArray | Format-Table -Property Number, Type, RelativePath -AutoSize + $DriverSelected = -1 + $skipDriverInstall = $false do { try { $var = $true - [int]$DriverSelected = Read-Host 'Enter the number of the driver source to install' - $DriverSelected = $DriverSelected - 1 + [int]$userSelection = Read-Host 'Enter the number of the driver source to install (0 to skip)' + if ($userSelection -eq 0) { + $skipDriverInstall = $true + break + } + $DriverSelected = $userSelection - 1 } catch { Write-Host 'Input was not in correct format. Please enter a valid number.' $var = $false } - } until (($DriverSelected -ge 0) -and ($DriverSelected -lt $DriverSourcesCount) -and $var) + } until ((($DriverSelected -ge 0 -and $DriverSelected -lt $DriverSourcesCount) -or $skipDriverInstall) -and $var) - $DriverSourcePath = $DriverSources[$DriverSelected].Path - $DriverSourceType = $DriverSources[$DriverSelected].Type - $selectedRelativePath = $DriverSources[$DriverSelected].RelativePath - WriteLog "User selected Type: $DriverSourceType, Path: $DriverSourcePath, RelativePath: $selectedRelativePath" - Write-Host "`nUser selected Type: $DriverSourceType, RelativePath: $selectedRelativePath" + if ($skipDriverInstall) { + $DriverSourcePath = $null + $DriverSourceType = $null + $selectedRelativePath = $null + WriteLog 'User chose to skip driver installation.' + Write-Host "`nDriver installation was skipped." + } + else { + $DriverSourcePath = $DriverSources[$DriverSelected].Path + $DriverSourceType = $DriverSources[$DriverSelected].Type + $selectedRelativePath = $DriverSources[$DriverSelected].RelativePath + WriteLog "User selected Type: $DriverSourceType, Path: $DriverSourcePath, RelativePath: $selectedRelativePath" + Write-Host "`nUser selected Type: $DriverSourceType, RelativePath: $selectedRelativePath" + } } } else {