mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 11:06:18 +00:00
Changed AppxPackage removal method for Windows 10 (#74)
This commit is contained in:
@@ -355,7 +355,14 @@ function RemoveApps {
|
|||||||
$app = '*' + $app + '*'
|
$app = '*' + $app + '*'
|
||||||
|
|
||||||
# Remove installed app for all existing users
|
# Remove installed app for all existing users
|
||||||
|
if ($WinVersion -ge 22000){
|
||||||
|
# Windows 11 build 22000 or later
|
||||||
Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -AllUsers
|
Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -AllUsers
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# Windows 10
|
||||||
|
Get-AppxPackage -Name $app -PackageTypeFilter Main, Bundle, Resource -AllUsers | Remove-AppxPackage -AllUsers
|
||||||
|
}
|
||||||
|
|
||||||
# Remove provisioned app from OS image, so the app won't be installed for any new users
|
# Remove provisioned app from OS image, so the app won't be installed for any new users
|
||||||
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $app } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }
|
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $app } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }
|
||||||
|
|||||||
Reference in New Issue
Block a user