From 9c1fc59af95f3c3a41b6988245b5f8448644c1b9 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Fri, 6 Sep 2024 11:24:16 -0700 Subject: [PATCH] - Added new variables for the PPKG, Unattend, Autopilot, and PEDrivers validation --- FFUDevelopment/BuildFFUVM.ps1 | 19 ++++++++++++++++++- .../{prefixes.txt => SamplePrefixes.txt} | 0 2 files changed, 18 insertions(+), 1 deletion(-) rename FFUDevelopment/unattend/{prefixes.txt => SamplePrefixes.txt} (100%) diff --git a/FFUDevelopment/BuildFFUVM.ps1 b/FFUDevelopment/BuildFFUVM.ps1 index 49d0a5b..33fce48 100644 --- a/FFUDevelopment/BuildFFUVM.ps1 +++ b/FFUDevelopment/BuildFFUVM.ps1 @@ -375,6 +375,11 @@ if (-not $DefenderPath) { $DefenderPath = "$AppsPath\Defender" } if (-not $OneDrivePath) { $OneDrivePath = "$AppsPath\OneDrive" } if (-not $EdgePath) { $EdgePath = "$AppsPath\Edge" } if (-not $DriversFolder) { $DriversFolder = "$FFUDevelopmentPath\Drivers" } +if (-not $PPKGFolder) { $PPKGFolder = "$FFUDevelopmentPath\PPKG" } +if (-not $UnattendFolder) { $UnattendFolder = "$FFUDevelopmentPath\Unattend" } +if (-not $AutopilotFolder) { $AutopilotFolder = "$FFUDevelopmentPath\Autopilot" } +if (-not $PEDriversFolder) { $PEDriversFolder = "$FFUDevelopmentPath\PEDrivers" } + #FUNCTIONS function WriteLog($LogText) { @@ -3609,6 +3614,18 @@ if ($InstallDrivers -or $CopyDrivers) { } } } +#Validate PEDrivers folder +if ($CopyPEDrivers) { + WriteLog 'Doing PEDriver validation' + if (!(Test-Path -Path $PEDriversFolder)) { + WriteLog "-CopyPEDrivers is set to `$true, but the $PEDriversFolder folder is missing" + throw "-CopyPEDrivers is set to `$true, but the $PEDriversFolder folder is missing" + } + if ((Get-ChildItem -Path $PEDriversFolder -Recurse | Measure-Object -Property Length -Sum).Sum -lt 1MB) { + WriteLog "-CopyPEDrivers is set to `$true, but the $PEDriversFolder folder is empty" + throw "-CopyPEDrivers is set to `$true, but the $PEDriversFolder folder is empty" + } +} #Validate PPKG folder if ($CopyPPKG) { @@ -3806,7 +3823,7 @@ if ($InstallApps) { ###### 9/4/2024 - Windows Security Platform update is no longer available from Update Catalog. Will change to using ###### https://support.microsoft.com/en-us/topic/windows-security-update-a6ac7d2e-b1bf-44c0-a028-41720a242da3 - + # #Get Windows Security platform update # $Name = "Windows Security platform definition updates" # WriteLog "Searching for $Name from Microsoft Update Catalog and saving to $DefenderPath" diff --git a/FFUDevelopment/unattend/prefixes.txt b/FFUDevelopment/unattend/SamplePrefixes.txt similarity index 100% rename from FFUDevelopment/unattend/prefixes.txt rename to FFUDevelopment/unattend/SamplePrefixes.txt