From 1d4cf4a80163dc4d668e221f6d5454e19d98c816 Mon Sep 17 00:00:00 2001 From: Raphire <9938813+Raphire@users.noreply.github.com> Date: Wed, 18 Mar 2026 19:28:47 +0100 Subject: [PATCH] Fix: Skip confirmation when running last used settings with `-Silent` parameter #521 --- Scripts/CLI/ShowCLIDefaultModeOptions.ps1 | 4 +--- Scripts/CLI/ShowCLILastUsedSettings.ps1 | 6 +++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Scripts/CLI/ShowCLIDefaultModeOptions.ps1 b/Scripts/CLI/ShowCLIDefaultModeOptions.ps1 index f7e7dd4..78152d1 100644 --- a/Scripts/CLI/ShowCLIDefaultModeOptions.ps1 +++ b/Scripts/CLI/ShowCLIDefaultModeOptions.ps1 @@ -17,7 +17,6 @@ function ShowCLIDefaultModeOptions { PrintHeader 'Default Mode' - # Add default settings based on user input try { # Select app removal options based on user input switch ($RemoveAppsInput) { @@ -35,7 +34,6 @@ function ShowCLIDefaultModeOptions { } } - # Load settings from DefaultSettings.json and add to params LoadSettings -filePath $script:DefaultSettingsFilePath -expectedVersion "1.0" } catch { @@ -45,8 +43,8 @@ function ShowCLIDefaultModeOptions { SaveSettings - # Skip change summary if Silent parameter was passed if ($Silent) { + # Skip change summary and confirmation prompt return } diff --git a/Scripts/CLI/ShowCLILastUsedSettings.ps1 b/Scripts/CLI/ShowCLILastUsedSettings.ps1 index 06f9022..08b544a 100644 --- a/Scripts/CLI/ShowCLILastUsedSettings.ps1 +++ b/Scripts/CLI/ShowCLILastUsedSettings.ps1 @@ -3,7 +3,6 @@ function ShowCLILastUsedSettings { PrintHeader 'Custom Mode' try { - # Load settings from LastUsedSettings.json and add to params LoadSettings -filePath $script:SavedSettingsFilePath -expectedVersion "1.0" } catch { @@ -11,6 +10,11 @@ function ShowCLILastUsedSettings { AwaitKeyToExit } + if ($Silent) { + # Skip change summary and confirmation prompt + return + } + PrintPendingChanges PrintHeader 'Custom Mode' } \ No newline at end of file