Add 'Remove Apps Folder Content' checkbox to UI and update related logic

- Introduced a new checkbox in the UI for removing application content in the Apps folder after FFU capture.
- Updated the Get-UIConfig function to retrieve the state of the new checkbox.
- Added default value for the new 'RemoveApps' parameter in the general defaults.
This commit is contained in:
rbalsleyMSFT
2025-05-28 17:43:59 -07:00
parent f6c8172676
commit 43223ad1cc
3 changed files with 6 additions and 1 deletions
+4 -1
View File
@@ -648,7 +648,7 @@ function Get-UIConfig {
Processors = [int]$window.FindName('txtProcessors').Text
ProductKey = $window.FindName('txtProductKey').Text
PromptExternalHardDiskMedia = $window.FindName('chkPromptExternalHardDiskMedia').IsChecked
RemoveApps = $false # Parameter from Sample_default.json, no UI control
RemoveApps = $window.FindName('chkRemoveApps').IsChecked
RemoveFFU = $window.FindName('chkRemoveFFU').IsChecked
RemoveUpdates = $false # Parameter from Sample_default.json, no UI control
ShareName = $window.FindName('txtShareName').Text
@@ -1601,6 +1601,7 @@ $window.Add_Loaded({
$script:chkInstallDrivers = $window.FindName('chkInstallDrivers')
$script:chkCopyDrivers = $window.FindName('chkCopyDrivers')
$script:chkCompressDriversToWIM = $window.FindName('chkCompressDriversToWIM')
$script:chkRemoveApps = $window.FindName('chkRemoveApps')
# AppsScriptVariables Controls
$script:chkDefineAppsScriptVariables = $window.FindName('chkDefineAppsScriptVariables')
@@ -1726,6 +1727,7 @@ $window.Add_Loaded({
$window.FindName('chkCleanupDeployISO').IsChecked = $script:generalDefaults.CleanupDeployISO
$window.FindName('chkCleanupDrivers').IsChecked = $script:generalDefaults.CleanupDrivers
$window.FindName('chkRemoveFFU').IsChecked = $script:generalDefaults.RemoveFFU
$script:chkRemoveApps.IsChecked = $script:generalDefaults.RemoveApps # New
# Hyper-V Settings defaults from General Defaults
$window.FindName('txtDiskSize').Text = $script:generalDefaults.DiskSizeGB
@@ -3023,6 +3025,7 @@ $btnLoadConfig.Add_Click({
Set-UIValue -ControlName 'chkCleanupDeployISO' -PropertyName 'IsChecked' -ConfigObject $configContent -ConfigKey 'CleanupDeployISO' -WindowInstance $window
Set-UIValue -ControlName 'chkCleanupDrivers' -PropertyName 'IsChecked' -ConfigObject $configContent -ConfigKey 'CleanupDrivers' -WindowInstance $window
Set-UIValue -ControlName 'chkRemoveFFU' -PropertyName 'IsChecked' -ConfigObject $configContent -ConfigKey 'RemoveFFU' -WindowInstance $window
Set-UIValue -ControlName 'chkRemoveApps' -PropertyName 'IsChecked' -ConfigObject $configContent -ConfigKey 'RemoveApps' -WindowInstance $window # New
# Hyper-V Settings
Set-UIValue -ControlName 'cmbVMSwitchName' -PropertyName 'SelectedItem' -ConfigObject $configContent -ConfigKey 'VMSwitchName' -WindowInstance $window