Forces capture media creation when installing apps

Removes the check for a pre-existing capture ISO when applications are being installed.

This change simplifies the logic by unconditionally creating the capture media if `InstallApps` is enabled. This ensures the media is always correctly configured for capturing the virtual machine to an FFU.
This commit is contained in:
rbalsleyMSFT
2025-07-17 12:22:04 -07:00
parent 71b3989083
commit 56c811ad89
+1 -7
View File
@@ -3781,15 +3781,9 @@ if ($CopyUnattend) {
# If InstallApps is true, we need capture media. # If InstallApps is true, we need capture media.
if ($InstallApps) { if ($InstallApps) {
if (-not $CreateCaptureMedia) { if (-not $CreateCaptureMedia) {
if (-not (Test-Path -Path $CaptureISO)) { WriteLog "InstallApps is true, but CreateCaptureMedia is false. Forcing to true to allow for VM capture to FFU."
WriteLog "InstallApps is true, but CreateCaptureMedia is false and the capture ISO does not exist at $CaptureISO."
WriteLog "Forcing CreateCaptureMedia to true to build the required capture media."
$CreateCaptureMedia = $true $CreateCaptureMedia = $true
} }
else {
WriteLog "InstallApps is true. Using existing capture media found at $CaptureISO."
}
}
} }
#Override $InstallApps value if using ESD to build FFU. This is due to a strange issue where building the FFU #Override $InstallApps value if using ESD to build FFU. This is due to a strange issue where building the FFU