From 469751f8e8f592502034d9b2c3535e32cab92715 Mon Sep 17 00:00:00 2001 From: HetCreep Date: Sun, 21 Jun 2026 23:39:10 +0700 Subject: [PATCH] fix(app-removal): don't treat AllUsers/CurrentUser as a username at startup (#647) --- Win11Debloat.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index 21792da..a3c018a 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -423,7 +423,11 @@ if ($script:Params.ContainsKey("User")) { GetUserDirectory -userName $script:Params.Item("User") | Out-Null } if ($script:Params.ContainsKey("AppRemovalTarget")) { - GetUserDirectory -userName $script:Params.Item("AppRemovalTarget") | Out-Null + $appRemovalTargetValue = $script:Params.Item("AppRemovalTarget") + # 'AllUsers' / 'CurrentUser' are sentinel scope values, not real usernames - don't resolve them as a profile + if ($appRemovalTargetValue -notin @('AllUsers', 'CurrentUser')) { + GetUserDirectory -userName $appRemovalTargetValue | Out-Null + } } # Remove LastUsedSettings.json file if it exists and is empty