2026-02-15 23:08:54 +01:00
|
|
|
# Shows the CLI menu options and prompts the user to select one. Loops until a valid option is selected.
|
2026-07-19 22:06:07 +02:00
|
|
|
function Show-CliMenuOptions {
|
2026-02-15 23:08:54 +01:00
|
|
|
Do {
|
|
|
|
|
$ModeSelectionMessage = "Please select an option (1/2)"
|
|
|
|
|
|
2026-07-19 22:06:07 +02:00
|
|
|
Write-CliHeader 'Menu'
|
2026-02-15 23:08:54 +01:00
|
|
|
|
|
|
|
|
Write-Host "(1) Default mode: Quickly apply the recommended changes"
|
|
|
|
|
Write-Host "(2) App removal mode: Select & remove apps, without making other changes"
|
|
|
|
|
|
|
|
|
|
# Only show this option if SavedSettings file exists
|
|
|
|
|
if (Test-Path $script:SavedSettingsFilePath) {
|
|
|
|
|
Write-Host "(3) Quickly apply your last used settings"
|
|
|
|
|
|
|
|
|
|
$ModeSelectionMessage = "Please select an option (1/2/3)"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Write-Host ""
|
|
|
|
|
Write-Host ""
|
|
|
|
|
|
|
|
|
|
$Mode = Read-Host $ModeSelectionMessage
|
|
|
|
|
|
|
|
|
|
if (($Mode -eq '3') -and -not (Test-Path $script:SavedSettingsFilePath)) {
|
|
|
|
|
$Mode = $null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
while ($Mode -ne '1' -and $Mode -ne '2' -and $Mode -ne '3')
|
|
|
|
|
|
|
|
|
|
return $Mode
|
|
|
|
|
}
|