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
+2 -8
View File
@@ -3781,14 +3781,8 @@ if ($CopyUnattend) {
# If InstallApps is true, we need capture media.
if ($InstallApps) {
if (-not $CreateCaptureMedia) {
if (-not (Test-Path -Path $CaptureISO)) {
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
}
else {
WriteLog "InstallApps is true. Using existing capture media found at $CaptureISO."
}
WriteLog "InstallApps is true, but CreateCaptureMedia is false. Forcing to true to allow for VM capture to FFU."
$CreateCaptureMedia = $true
}
}