win: improve system app uninstall /w fallback #260
This commit improves soft deletion of system apps. Before if the package was missing, it failed to recover or delete system apps. Now, it works even though if `Get-AppxPackage` returns null (i.e. package is non-existing), so it can be executed even after a hard delete. This allows safely introducing hard-delete of system apps (as discussed in #260) with still keeping a robust soft-delete as complement. Before, the script was dependent on `Get-AppxPackage.InstallLocation`, however a system app can only be located in one of these folders: - C:\Windows\SystemApps\{PackageFamilyName} - C:\Windows\{ShortAppName} To ensure resilience, this commit adjust the script to rename the files within these directories if Get-AppxPackage fails, this provides a fallback.
This commit is contained in:
@@ -5999,9 +5999,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ❌ Missing
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ❌ Missing
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.Windows.SecHealthUI
|
# More info : Get-AppxPackage Microsoft.Windows.SecHealthUI
|
||||||
packageName: Microsoft.Windows.SecHealthUI
|
packageName: Microsoft.Windows.SecHealthUI
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
category: UI for privacy
|
category: UI for privacy
|
||||||
children:
|
children:
|
||||||
@@ -7733,7 +7733,7 @@ actions:
|
|||||||
This category includes scripts for uninstalling default system apps in Windows.
|
This category includes scripts for uninstalling default system apps in Windows.
|
||||||
|
|
||||||
System apps are pre-installed [1] [2] applications located in the `C:\Windows*` directory [1] [2].
|
System apps are pre-installed [1] [2] applications located in the `C:\Windows*` directory [1] [2].
|
||||||
These apps are typically found on `C:\Windows\SystemApps\{PackageFamilyName}` or `C:\Windows\{AppName}` folders.
|
These apps are typically found on `C:\Windows\SystemApps\{PackageFamilyName}` or `C:\Windows\{ShortAppName}` folders.
|
||||||
|
|
||||||
To view all system apps:
|
To view all system apps:
|
||||||
|
|
||||||
@@ -7758,9 +7758,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage 1527c705-839a-4832-9118-54d4Bd6a0c89
|
# More info : Get-AppxPackage 1527c705-839a-4832-9118-54d4Bd6a0c89
|
||||||
packageName: 1527c705-839a-4832-9118-54d4Bd6a0c89
|
packageName: 1527c705-839a-4832-9118-54d4Bd6a0c89
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "File Explorer" app
|
name: Remove "File Explorer" app
|
||||||
docs: |
|
docs: |
|
||||||
@@ -7772,9 +7772,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage c5e2524a-ea46-4f67-841f-6a9465d9d515
|
# More info : Get-AppxPackage c5e2524a-ea46-4f67-841f-6a9465d9d515
|
||||||
packageName: c5e2524a-ea46-4f67-841f-6a9465d9d515
|
packageName: c5e2524a-ea46-4f67-841f-6a9465d9d515
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "App Resolver UX" app
|
name: Remove "App Resolver UX" app
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -7786,9 +7786,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage E2A4F912-2574-4A75-9BB0-0D023378592B
|
# More info : Get-AppxPackage E2A4F912-2574-4A75-9BB0-0D023378592B
|
||||||
packageName: E2A4F912-2574-4A75-9BB0-0D023378592B
|
packageName: E2A4F912-2574-4A75-9BB0-0D023378592B
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Add Suggested Folders To Library" app
|
name: Remove "Add Suggested Folders To Library" app
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -7801,16 +7801,16 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE
|
# More info : Get-AppxPackage F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE
|
||||||
packageName: F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE
|
packageName: F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage InputApp
|
# More info : Get-AppxPackage InputApp
|
||||||
packageName: InputApp
|
packageName: InputApp
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Microsoft AAD Broker Plugin" app (breaks Night Light settings, taskbar keyboard selection and Office app authentication)
|
name: Remove "Microsoft AAD Broker Plugin" app (breaks Night Light settings, taskbar keyboard selection and Office app authentication)
|
||||||
# recommend: strict (Unrecommended due to too many side-effects)
|
# recommend: strict (Unrecommended due to too many side-effects)
|
||||||
@@ -7843,9 +7843,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.AAD.BrokerPlugin
|
# More info : Get-AppxPackage Microsoft.AAD.BrokerPlugin
|
||||||
packageName: Microsoft.AAD.BrokerPlugin # Offical docs point to wrong "Microsoft.AAD.Broker.Plugin"
|
packageName: Microsoft.AAD.BrokerPlugin # Offical docs point to wrong "Microsoft.AAD.Broker.Plugin"
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Microsoft Accounts Control" app
|
name: Remove "Microsoft Accounts Control" app
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -7860,9 +7860,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.AccountsControl
|
# More info : Get-AppxPackage Microsoft.AccountsControl
|
||||||
packageName: Microsoft.AccountsControl
|
packageName: Microsoft.AccountsControl
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Microsoft Async Text Service" app
|
name: Remove "Microsoft Async Text Service" app
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -7874,9 +7874,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : 8wekyb3d8bbwe
|
|
||||||
# More info : Get-AppxPackage Microsoft.AsyncTextService
|
# More info : Get-AppxPackage Microsoft.AsyncTextService
|
||||||
packageName: Microsoft.AsyncTextService
|
packageName: Microsoft.AsyncTextService
|
||||||
|
publisherId: 8wekyb3d8bbwe
|
||||||
-
|
-
|
||||||
category: Remove Windows Hello setup UI apps
|
category: Remove Windows Hello setup UI apps
|
||||||
children:
|
children:
|
||||||
@@ -7894,9 +7894,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.BioEnrollment
|
# More info : Get-AppxPackage Microsoft.BioEnrollment
|
||||||
packageName: Microsoft.BioEnrollment
|
packageName: Microsoft.BioEnrollment
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Credentials Dialog Host" app
|
name: Remove "Credentials Dialog Host" app
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -7909,9 +7909,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.CredDialogHost
|
# More info : Get-AppxPackage Microsoft.CredDialogHost
|
||||||
packageName: Microsoft.CredDialogHost
|
packageName: Microsoft.CredDialogHost
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "EC" app
|
name: Remove "EC" app
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -7923,9 +7923,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : 8wekyb3d8bbwe
|
|
||||||
# More info : Get-AppxPackage Microsoft.ECApp
|
# More info : Get-AppxPackage Microsoft.ECApp
|
||||||
packageName: Microsoft.ECApp
|
packageName: Microsoft.ECApp
|
||||||
|
publisherId: 8wekyb3d8bbwe
|
||||||
-
|
-
|
||||||
name: Remove "Lock" app (shows lock screen)
|
name: Remove "Lock" app (shows lock screen)
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -7939,9 +7939,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.LockApp
|
# More info : Get-AppxPackage Microsoft.LockApp
|
||||||
packageName: Microsoft.LockApp
|
packageName: Microsoft.LockApp
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
category: Remove Edge apps
|
category: Remove Edge apps
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -7992,9 +7992,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : 8wekyb3d8bbwe
|
|
||||||
# More info : Get-AppxPackage Microsoft.MicrosoftEdge
|
# More info : Get-AppxPackage Microsoft.MicrosoftEdge
|
||||||
packageName: Microsoft.MicrosoftEdge
|
packageName: Microsoft.MicrosoftEdge
|
||||||
|
publisherId: 8wekyb3d8bbwe
|
||||||
-
|
-
|
||||||
name: Remove "Microsoft Edge Dev Tools Client" app
|
name: Remove "Microsoft Edge Dev Tools Client" app
|
||||||
recommend: strict
|
recommend: strict
|
||||||
@@ -8018,9 +8018,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : 8wekyb3d8bbwe
|
|
||||||
# More info : Get-AppxPackage Microsoft.MicrosoftEdgeDevToolsClient
|
# More info : Get-AppxPackage Microsoft.MicrosoftEdgeDevToolsClient
|
||||||
packageName: Microsoft.MicrosoftEdgeDevToolsClient
|
packageName: Microsoft.MicrosoftEdgeDevToolsClient
|
||||||
|
publisherId: 8wekyb3d8bbwe
|
||||||
-
|
-
|
||||||
name: Remove Edge (legacy) file and URL associations
|
name: Remove Edge (legacy) file and URL associations
|
||||||
recommend: strict
|
recommend: strict
|
||||||
@@ -8078,9 +8078,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.Win32WebViewHost
|
# More info : Get-AppxPackage Microsoft.Win32WebViewHost
|
||||||
packageName: Microsoft.Win32WebViewHost
|
packageName: Microsoft.Win32WebViewHost
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Microsoft PPI Projection" app
|
name: Remove "Microsoft PPI Projection" app
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -8095,9 +8095,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.PPIProjection
|
# More info : Get-AppxPackage Microsoft.PPIProjection
|
||||||
packageName: Microsoft.PPIProjection
|
packageName: Microsoft.PPIProjection
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "ChxApp" app
|
name: Remove "ChxApp" app
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -8109,9 +8109,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.Windows.Apprep.ChxApp
|
# More info : Get-AppxPackage Microsoft.Windows.Apprep.ChxApp
|
||||||
packageName: Microsoft.Windows.Apprep.ChxApp
|
packageName: Microsoft.Windows.Apprep.ChxApp
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Assigned Access Lock App" app
|
name: Remove "Assigned Access Lock App" app
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -8123,9 +8123,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.Windows.AssignedAccessLockApp
|
# More info : Get-AppxPackage Microsoft.Windows.AssignedAccessLockApp
|
||||||
packageName: Microsoft.Windows.AssignedAccessLockApp
|
packageName: Microsoft.Windows.AssignedAccessLockApp
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Capture Picker" app
|
name: Remove "Capture Picker" app
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -8137,9 +8137,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.Windows.CapturePicker
|
# More info : Get-AppxPackage Microsoft.Windows.CapturePicker
|
||||||
packageName: Microsoft.Windows.CapturePicker
|
packageName: Microsoft.Windows.CapturePicker
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Cloud Experience Host" app (breaks Windows Hello password/PIN sign-in options, and Microsoft cloud/corporate sign in)
|
name: Remove "Cloud Experience Host" app (breaks Windows Hello password/PIN sign-in options, and Microsoft cloud/corporate sign in)
|
||||||
# recommend: strict (Unrecommended due to too many side-effects)
|
# recommend: strict (Unrecommended due to too many side-effects)
|
||||||
@@ -8180,9 +8180,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.Windows.CloudExperienceHost
|
# More info : Get-AppxPackage Microsoft.Windows.CloudExperienceHost
|
||||||
packageName: Microsoft.Windows.CloudExperienceHost
|
packageName: Microsoft.Windows.CloudExperienceHost
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Content Delivery Manager" app
|
name: Remove "Content Delivery Manager" app
|
||||||
recommend: strict
|
recommend: strict
|
||||||
@@ -8206,9 +8206,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.Windows.ContentDeliveryManager
|
# More info : Get-AppxPackage Microsoft.Windows.ContentDeliveryManager
|
||||||
packageName: Microsoft.Windows.ContentDeliveryManager
|
packageName: Microsoft.Windows.ContentDeliveryManager
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
category: Remove Cortana system apps
|
category: Remove Cortana system apps
|
||||||
children:
|
children:
|
||||||
@@ -8238,9 +8238,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
||||||
# Publisher ID : cw5n1h2txyew
|
|
||||||
# More info : Get-AppxPackage Microsoft.Windows.Cortana
|
# More info : Get-AppxPackage Microsoft.Windows.Cortana
|
||||||
packageName: Microsoft.Windows.Cortana # Removed since version 2004
|
packageName: Microsoft.Windows.Cortana # Removed since version 2004
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
function: UninstallStoreApp
|
function: UninstallStoreApp
|
||||||
parameters:
|
parameters:
|
||||||
@@ -8265,9 +8265,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
||||||
# Publisher ID : cw5n1h2txyew
|
|
||||||
# More info : Get-AppxPackage Microsoft.Windows.Holographic.FirstRun
|
# More info : Get-AppxPackage Microsoft.Windows.Holographic.FirstRun
|
||||||
packageName: Microsoft.Windows.Holographic.FirstRun
|
packageName: Microsoft.Windows.Holographic.FirstRun
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
category: Remove Out-of-Box Experience (OOBE) apps
|
category: Remove Out-of-Box Experience (OOBE) apps
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -8296,9 +8296,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.Windows.OOBENetworkCaptivePortal
|
# More info : Get-AppxPackage Microsoft.Windows.OOBENetworkCaptivePortal
|
||||||
packageName: Microsoft.Windows.OOBENetworkCaptivePortal # Offical docs point to wrong "Microsoft.Windows.OOBENetworkCaptivePort"
|
packageName: Microsoft.Windows.OOBENetworkCaptivePortal # Offical docs point to wrong "Microsoft.Windows.OOBENetworkCaptivePort"
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "OOBE Network Connection Flow" app
|
name: Remove "OOBE Network Connection Flow" app
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -8324,9 +8324,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.Windows.OOBENetworkConnectionFlow
|
# More info : Get-AppxPackage Microsoft.Windows.OOBENetworkConnectionFlow
|
||||||
packageName: Microsoft.Windows.OOBENetworkConnectionFlow
|
packageName: Microsoft.Windows.OOBENetworkConnectionFlow
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Microsoft Family Safety" / "Parental control" app
|
name: Remove "Microsoft Family Safety" / "Parental control" app
|
||||||
recommend: standard
|
recommend: standard
|
||||||
@@ -8358,9 +8358,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.Windows.ParentalControls
|
# More info : Get-AppxPackage Microsoft.Windows.ParentalControls
|
||||||
packageName: Microsoft.Windows.ParentalControls
|
packageName: Microsoft.Windows.ParentalControls
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
category: Remove People Hub apps
|
category: Remove People Hub apps
|
||||||
children:
|
children:
|
||||||
@@ -8389,9 +8389,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.Windows.PeopleExperienceHost
|
# More info : Get-AppxPackage Microsoft.Windows.PeopleExperienceHost
|
||||||
packageName: Microsoft.Windows.PeopleExperienceHost
|
packageName: Microsoft.Windows.PeopleExperienceHost
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Pinning Confirmation Dialog" app
|
name: Remove "Pinning Confirmation Dialog" app
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -8403,9 +8403,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.Windows.PinningConfirmationDialog
|
# More info : Get-AppxPackage Microsoft.Windows.PinningConfirmationDialog
|
||||||
packageName: Microsoft.Windows.PinningConfirmationDialog
|
packageName: Microsoft.Windows.PinningConfirmationDialog
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Secondary Tile Experience" app
|
name: Remove "Secondary Tile Experience" app
|
||||||
recommend: strict
|
recommend: strict
|
||||||
@@ -8427,9 +8427,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.Windows.SecondaryTileExperience
|
# More info : Get-AppxPackage Microsoft.Windows.SecondaryTileExperience
|
||||||
packageName: Microsoft.Windows.SecondaryTileExperience
|
packageName: Microsoft.Windows.SecondaryTileExperience
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Take a Test" app
|
name: Remove "Take a Test" app
|
||||||
recommend: strict
|
recommend: strict
|
||||||
@@ -8457,9 +8457,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.Windows.SecureAssessmentBrowser
|
# More info : Get-AppxPackage Microsoft.Windows.SecureAssessmentBrowser
|
||||||
packageName: Microsoft.Windows.SecureAssessmentBrowser
|
packageName: Microsoft.Windows.SecureAssessmentBrowser
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
category: Remove Windows Feedback apps
|
category: Remove Windows Feedback apps
|
||||||
children:
|
children:
|
||||||
@@ -8474,9 +8474,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.WindowsFeedback
|
# More info : Get-AppxPackage Microsoft.WindowsFeedback
|
||||||
packageName: Microsoft.WindowsFeedback
|
packageName: Microsoft.WindowsFeedback
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Xbox Game Callable UI" app (breaks Xbox Live games)
|
name: Remove "Xbox Game Callable UI" app (breaks Xbox Live games)
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -8497,9 +8497,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Microsoft.XboxGameCallableUI
|
# More info : Get-AppxPackage Microsoft.XboxGameCallableUI
|
||||||
packageName: Microsoft.XboxGameCallableUI
|
packageName: Microsoft.XboxGameCallableUI
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "CBS Preview" app
|
name: Remove "CBS Preview" app
|
||||||
recommend: standard
|
recommend: standard
|
||||||
@@ -8512,9 +8512,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Windows.CBSPreview
|
# More info : Get-AppxPackage Windows.CBSPreview
|
||||||
packageName: Windows.CBSPreview
|
packageName: Windows.CBSPreview
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Contact Support" app
|
name: Remove "Contact Support" app
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -8525,9 +8525,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Windows.ContactSupport
|
# More info : Get-AppxPackage Windows.ContactSupport
|
||||||
packageName: Windows.ContactSupport
|
packageName: Windows.ContactSupport
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Windows Print 3D" app
|
name: Remove "Windows Print 3D" app
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -8539,9 +8539,9 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
# Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Windows.Print3D
|
# More info : Get-AppxPackage Windows.Print3D
|
||||||
packageName: Windows.Print3D
|
packageName: Windows.Print3D
|
||||||
|
publisherId: cw5n1h2txyewy
|
||||||
-
|
-
|
||||||
name: Remove "Print UI" app
|
name: Remove "Print UI" app
|
||||||
docs: |-
|
docs: |-
|
||||||
@@ -8553,10 +8553,10 @@ actions:
|
|||||||
function: UninstallSystemApp
|
function: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
# Existence : Windows 10 (≥ 22H2): ✅ Exists | Windows 11 (≥ 22H2): ✅ Exists
|
||||||
# Publisher ID : cw5n1h2txyewy
|
|
||||||
# More info : Get-AppxPackage Windows.PrintDialog
|
# More info : Get-AppxPackage Windows.PrintDialog
|
||||||
packageName: Windows.PrintDialog
|
packageName: Windows.PrintDialog
|
||||||
-
|
publisherId: cw5n1h2txyewy
|
||||||
|
-
|
||||||
category: Remove OneDrive
|
category: Remove OneDrive
|
||||||
docs: |-
|
docs: |-
|
||||||
Microsoft OneDrive (formerly SkyDrive) is a file hosting service operated by Microsoft [1].
|
Microsoft OneDrive (formerly SkyDrive) is a file hosting service operated by Microsoft [1].
|
||||||
@@ -9797,14 +9797,17 @@ functions:
|
|||||||
name: UninstallSystemApp
|
name: UninstallSystemApp
|
||||||
parameters:
|
parameters:
|
||||||
- name: packageName
|
- name: packageName
|
||||||
# It simply renames folders
|
- name: publisherId
|
||||||
|
# It simply renames files in application folders.
|
||||||
# Because system apps are non removable (check: (Get-AppxPackage -AllUsers 'Windows.CBSPreview').NonRemovable)
|
# Because system apps are non removable (check: (Get-AppxPackage -AllUsers 'Windows.CBSPreview').NonRemovable)
|
||||||
# Otherwise they throw 0x80070032 when trying to uninstall them
|
# Otherwise they throw 0x80070032 when trying to uninstall them
|
||||||
# This script all files in three application folders to make them inaccessible for the operating system:
|
# This script all files in three application folders to make them inaccessible for the operating system:
|
||||||
# 1. Installation
|
# 1. Installation
|
||||||
# - Parent : `%WINDIR%\SystemApps\{PackageFamilyName}` or `%WINDIR%\{AppName}`
|
# - Parent : `%WINDIR%\SystemApps\{PackageFamilyName}` or `%WINDIR%\{AppName}`
|
||||||
# - Example : `C:\Windows\SystemApps\Windows.CBSPreview_cw5n1h2txyewy` or `C:\Windows\PrintDialog`
|
# - Example : `C:\Windows\SystemApps\Windows.CBSPreview_cw5n1h2txyewy` or `C:\Windows\PrintDialog`
|
||||||
# - Check : `(Get-AppxPackage -AllUsers 'Windows.CBSPreview').InstallLocation` or `(Get-AppxPackage -AllUsers 'Windows.PrintDialog').InstallLocation`
|
# - Check :
|
||||||
|
# - `(Get-AppxPackage -AllUsers 'Windows.CBSPreview').InstallLocation` or `(Get-AppxPackage -AllUsers 'Windows.PrintDialog').InstallLocation`
|
||||||
|
# - `Get-AppxPackage -PackageTypeFilter Main | ? { $_.SignatureKind -eq "System" } | Sort Name | Format-Table Name, InstallLocation`
|
||||||
# 2. User-specific data
|
# 2. User-specific data
|
||||||
# - Parent : %LOCALAPPDATA%\Packages\
|
# - Parent : %LOCALAPPDATA%\Packages\
|
||||||
# - Example : C:\Users\undergroundwires\AppData\Local\Packages\Windows.CBSPreview_cw5n1h2txyewy
|
# - Example : C:\Users\undergroundwires\AppData\Local\Packages\Windows.CBSPreview_cw5n1h2txyewy
|
||||||
@@ -9818,17 +9821,24 @@ functions:
|
|||||||
parameters:
|
parameters:
|
||||||
code: |-
|
code: |-
|
||||||
$packageName = '{{ $packageName }}'
|
$packageName = '{{ $packageName }}'
|
||||||
|
$publisherId='{{ $publisherId }}'
|
||||||
Write-Host "Soft-deleting `"$packageName`" folders."
|
Write-Host "Soft-deleting `"$packageName`" folders."
|
||||||
$package = Get-AppxPackage -AllUsers $packageName
|
|
||||||
if (!$package) {
|
|
||||||
Write-Host "Skipping, package `"$packageName`" is not installed."
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
$directories = @(
|
$directories = @(
|
||||||
@{ Name = 'Installation'; Path = $package.InstallLocation; }
|
|
||||||
@{ Name = 'User-specific data'; Path = "$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)"; }
|
@{ Name = 'User-specific data'; Path = "$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)"; }
|
||||||
@{ Name = 'Metadata'; Path = "$env:PROGRAMDATA\Microsoft\Windows\AppRepository\Packages\$($package.PackageFullName)"; }
|
@{ Name = 'Metadata'; Path = "$env:PROGRAMDATA\Microsoft\Windows\AppRepository\Packages\$($package.PackageFullName)"; }
|
||||||
)
|
)
|
||||||
|
$package = Get-AppxPackage -AllUsers $packageName
|
||||||
|
if ($package -and $package.InstallLocation) {
|
||||||
|
$directories += @{ Name = 'Installation'; Path = $package.InstallLocation; }
|
||||||
|
} else {
|
||||||
|
Write-Host "The package `"$packageName`" could not be found, residual files will still be handled."
|
||||||
|
$packageFamilyName = "$($packageName)_$($publisherId)"
|
||||||
|
$appShortName = ($packageName -Split '\.')[-1]
|
||||||
|
$directories +=@(
|
||||||
|
@{ Name = 'Installation (SystemApps)'; Path = "$env:WINDIR\SystemApps\$packageFamilyName"; }
|
||||||
|
@{ Name = 'Installation (Root)'; Path = "$env:WINDIR\$appShortName"; }
|
||||||
|
)
|
||||||
|
}
|
||||||
foreach($directory in $directories) {
|
foreach($directory in $directories) {
|
||||||
Write-Host "Processing folder: `"$($directory.Name)`"..."
|
Write-Host "Processing folder: `"$($directory.Name)`"..."
|
||||||
if (!$directory.Path) {
|
if (!$directory.Path) {
|
||||||
@@ -9865,16 +9875,24 @@ functions:
|
|||||||
}
|
}
|
||||||
revertCode: |-
|
revertCode: |-
|
||||||
$packageName = '{{ $packageName }}'
|
$packageName = '{{ $packageName }}'
|
||||||
$package = Get-AppxPackage -AllUsers $packageName
|
$publisherId='{{ $publisherId }}'
|
||||||
Write-Host "Restoring `"$packageName`" folders."
|
Write-Host "Restoring `"$packageName`" folders."
|
||||||
if (!$package) {
|
|
||||||
throw "The package `"$packageName`" could not be found."
|
|
||||||
}
|
|
||||||
$directories = @(
|
$directories = @(
|
||||||
@{ Name = 'Installation'; Path = $package.InstallLocation; }
|
|
||||||
@{ Name = 'User-specific data'; Path = "$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)"; }
|
@{ Name = 'User-specific data'; Path = "$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)"; }
|
||||||
@{ Name = 'Metadata'; Path = "$env:PROGRAMDATA\Microsoft\Windows\AppRepository\Packages\$($package.PackageFullName)"; }
|
@{ Name = 'Metadata'; Path = "$env:PROGRAMDATA\Microsoft\Windows\AppRepository\Packages\$($package.PackageFullName)"; }
|
||||||
)
|
)
|
||||||
|
$package = Get-AppxPackage -AllUsers $packageName
|
||||||
|
if ($package -and $package.InstallLocation) {
|
||||||
|
$directories += @{ Name = 'Installation'; Path = $package.InstallLocation; }
|
||||||
|
} else {
|
||||||
|
Write-Warning "The package `"$packageName`" could not be found, its files will still be handled."
|
||||||
|
$packageFamilyName = "$($packageName)_$($publisherId)"
|
||||||
|
$appShortName = ($packageName -Split '\.')[-1]
|
||||||
|
$directories +=@(
|
||||||
|
@{ Name = 'Installation (SystemApps)'; Path = "$env:WINDIR\SystemApps\$packageFamilyName"; }
|
||||||
|
@{ Name = 'Installation (Root)'; Path = "$env:WINDIR\$appShortName"; }
|
||||||
|
)
|
||||||
|
}
|
||||||
foreach ($directory in $directories) {
|
foreach ($directory in $directories) {
|
||||||
Write-Host "Processing folder: `"$($directory.Name)`" directory..."
|
Write-Host "Processing folder: `"$($directory.Name)`" directory..."
|
||||||
if (!$directory.Path) {
|
if (!$directory.Path) {
|
||||||
|
|||||||
Reference in New Issue
Block a user