mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-01-01 08:56:21 +00:00
Exit after config version check fails
This commit is contained in:
@@ -1218,11 +1218,14 @@ function ShowDefaultModeOptions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PrintHeader 'Default Mode'
|
||||||
|
|
||||||
# Add default settings based on user input
|
# Add default settings based on user input
|
||||||
try {
|
try {
|
||||||
$defaultSettings = (Get-Content -Path $script:DefaultSettingsFilePath -Raw | ConvertFrom-Json)
|
$defaultSettings = (Get-Content -Path $script:DefaultSettingsFilePath -Raw | ConvertFrom-Json)
|
||||||
if (-not $defaultSettings.Version -or $defaultSettings.Version -ne "1.0") {
|
if (-not $defaultSettings.Version -or $defaultSettings.Version -ne "1.0") {
|
||||||
Write-Warning "DefaultSettings.json version mismatch (expected 1.0, found $($defaultSettings.Version))"
|
Write-Error "DefaultSettings.json version mismatch (expected 1.0, found $($defaultSettings.Version))"
|
||||||
|
AwaitKeyToExit
|
||||||
}
|
}
|
||||||
|
|
||||||
# Select app removal options based on user input
|
# Select app removal options based on user input
|
||||||
@@ -1256,8 +1259,6 @@ function ShowDefaultModeOptions {
|
|||||||
|
|
||||||
SaveSettings
|
SaveSettings
|
||||||
|
|
||||||
PrintHeader 'Default Mode'
|
|
||||||
|
|
||||||
# Skip change summary if Silent parameter was passed
|
# Skip change summary if Silent parameter was passed
|
||||||
if ($Silent) {
|
if ($Silent) {
|
||||||
return
|
return
|
||||||
@@ -1830,7 +1831,8 @@ function LoadAndShowLastUsedSettings {
|
|||||||
try {
|
try {
|
||||||
$savedSettings = (Get-Content -Path $script:SavedSettingsFilePath -Raw | ConvertFrom-Json)
|
$savedSettings = (Get-Content -Path $script:SavedSettingsFilePath -Raw | ConvertFrom-Json)
|
||||||
if ($savedSettings.Version -and $savedSettings.Version -ne "1.0") {
|
if ($savedSettings.Version -and $savedSettings.Version -ne "1.0") {
|
||||||
Write-Warning "LastUsedSettings.json version mismatch (expected 1.0, found $($savedSettings.Version))"
|
Write-Error "LastUsedSettings.json version mismatch (expected 1.0, found $($savedSettings.Version))"
|
||||||
|
AwaitKeyToExit
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not $savedSettings.Settings) {
|
if (-not $savedSettings.Settings) {
|
||||||
|
|||||||
Reference in New Issue
Block a user