From dc801e9cc92561ede671bc3d74cb519cc4cbdee8 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Tue, 3 Mar 2026 14:16:06 -0800 Subject: [PATCH] Adds dependency validation for copying drivers Prevents an invalid configuration state by ensuring the build USB drive option is explicitly requested whenever the copy drivers option is specified. --- FFUDevelopment/BuildFFUVM.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/FFUDevelopment/BuildFFUVM.ps1 b/FFUDevelopment/BuildFFUVM.ps1 index 268a03d..2e30d55 100644 --- a/FFUDevelopment/BuildFFUVM.ps1 +++ b/FFUDevelopment/BuildFFUVM.ps1 @@ -5126,6 +5126,12 @@ if ($LongPathsEnabled -ne 1) { Set-Progress -Percentage 2 -Message "Validating parameters..." ###PARAMETER VALIDATION +#Validate CopyDrivers dependency on BuildUSBDrive +if ($CopyDrivers -and (-not $BuildUSBDrive)) { + WriteLog "-CopyDrivers is set to `$true, but -BuildUSBDrive is not set to `$true" + throw "-CopyDrivers is set to `$true, but -BuildUSBDrive is not set to `$true. Please set -BuildUSBDrive to `$true and try again." +} + #Validate drivers folder if ($InstallDrivers -or $CopyDrivers) { WriteLog 'Doing driver validation'