mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Introduces an option to retain downloaded ESD files
Adds a new configuration parameter and UI toggle to control whether downloaded Windows ESD files are removed after application. Updates the download process to check for and reuse existing ESD files that match the latest metadata filename, saving bandwidth and time on subsequent executions. Integrates the conditional deletion logic into the shared cleanup module.
This commit is contained in:
@@ -82,6 +82,7 @@ function Get-UIConfig {
|
||||
RemoveApps = $State.Controls.chkRemoveApps.IsChecked
|
||||
RemoveFFU = $State.Controls.chkRemoveFFU.IsChecked
|
||||
RemoveUpdates = $State.Controls.chkRemoveUpdates.IsChecked
|
||||
RemoveDownloadedESD = $State.Controls.chkRemoveDownloadedESD.IsChecked
|
||||
ShareName = $State.Controls.txtShareName.Text
|
||||
UpdateADK = $State.Controls.chkUpdateADK.IsChecked
|
||||
UpdateEdge = $State.Controls.chkUpdateEdge.IsChecked
|
||||
@@ -461,6 +462,7 @@ function Update-UIFromConfig {
|
||||
Set-UIValue -ControlName 'chkRemoveFFU' -PropertyName 'IsChecked' -ConfigObject $ConfigContent -ConfigKey 'RemoveFFU' -State $State
|
||||
Set-UIValue -ControlName 'chkRemoveApps' -PropertyName 'IsChecked' -ConfigObject $ConfigContent -ConfigKey 'RemoveApps' -State $State
|
||||
Set-UIValue -ControlName 'chkRemoveUpdates' -PropertyName 'IsChecked' -ConfigObject $ConfigContent -ConfigKey 'RemoveUpdates' -State $State
|
||||
Set-UIValue -ControlName 'chkRemoveDownloadedESD' -PropertyName 'IsChecked' -ConfigObject $ConfigContent -ConfigKey 'RemoveDownloadedESD' -State $State
|
||||
|
||||
# Hyper-V Settings
|
||||
Select-VMSwitchFromConfig -State $State -ConfigContent $ConfigContent
|
||||
@@ -908,7 +910,8 @@ function Invoke-RestoreDefaults {
|
||||
-RemoveDrivers:$true `
|
||||
-RemoveFFU:$true `
|
||||
-RemoveApps:$true `
|
||||
-RemoveUpdates:$true
|
||||
-RemoveUpdates:$true `
|
||||
-RemoveDownloadedESD:$true
|
||||
|
||||
# Clear UI lists / state
|
||||
if ($null -ne $State.Data.allDriverModels) { $State.Data.allDriverModels.Clear() }
|
||||
|
||||
@@ -135,6 +135,7 @@ function Initialize-UIControls {
|
||||
$State.Controls.chkCleanupDeployISO = $window.FindName('chkCleanupDeployISO')
|
||||
$State.Controls.chkCleanupDrivers = $window.FindName('chkCleanupDrivers')
|
||||
$State.Controls.chkRemoveFFU = $window.FindName('chkRemoveFFU')
|
||||
$State.Controls.chkRemoveDownloadedESD = $window.FindName('chkRemoveDownloadedESD')
|
||||
$State.Controls.txtDiskSize = $window.FindName('txtDiskSize')
|
||||
$State.Controls.txtMemory = $window.FindName('txtMemory')
|
||||
$State.Controls.txtProcessors = $window.FindName('txtProcessors')
|
||||
@@ -258,6 +259,7 @@ function Initialize-UIDefaults {
|
||||
$State.Controls.chkRemoveFFU.IsChecked = $State.Defaults.generalDefaults.RemoveFFU
|
||||
$State.Controls.chkRemoveApps.IsChecked = $State.Defaults.generalDefaults.RemoveApps
|
||||
$State.Controls.chkRemoveUpdates.IsChecked = $State.Defaults.generalDefaults.RemoveUpdates
|
||||
$State.Controls.chkRemoveDownloadedESD.IsChecked = $State.Defaults.generalDefaults.RemoveDownloadedESD
|
||||
$State.Controls.chkVerbose.IsChecked = $State.Defaults.generalDefaults.Verbose
|
||||
$State.Controls.usbSection.Visibility = if ($State.Controls.chkBuildUSBDriveEnable.IsChecked) { 'Visible' } else { 'Collapsed' }
|
||||
$State.Controls.usbSelectionPanel.Visibility = if ($State.Controls.chkSelectSpecificUSBDrives.IsChecked) { 'Visible' } else { 'Collapsed' }
|
||||
|
||||
@@ -141,6 +141,7 @@ function Get-GeneralDefaults {
|
||||
RemoveFFU = $false
|
||||
RemoveApps = $false
|
||||
RemoveUpdates = $false
|
||||
RemoveDownloadedESD = $true
|
||||
# Hyper-V Settings Defaults
|
||||
VMHostIPAddress = ""
|
||||
DiskSizeGB = 50
|
||||
|
||||
Reference in New Issue
Block a user