2

I'm trying to debloat Windows 10 Education by running the following commands in a powershell script. I can get the script to remove the apps for the logged in user but as soon as someone new logs in, the apps reappear.

Here is my script:

Get-AppxPackage -AllUsers | where-object {$_.name –like “*3DBuilder*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*windowsalarms*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*windowscamera*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*windowscommunicationsapps*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*officehub*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*getstarted*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*windowsmap*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*solitairecollection*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*bingfinance*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*bingnews*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*zunevideo*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*people*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*windowsphone*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*bingsports*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*windowsstore*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*soundrecorder*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*bingweather*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*xboxapp*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*Appconnector*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*MinecraftUWP*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*Messaging*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*WindowsFeedbackHub*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*Getstarted*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*GetHelp*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*ContactSupport*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*Wallet*”} | Remove-AppxPackage
Get-AppxPackage -AllUsers | where-object {$_.name –like “*OneConnect*”} | Remove-AppxPackage

Any advice would be much appreciated.

2 Answers 2

3

I'm not 100% sure but I think you need to use the -Online parameter

$Apps = Get-AppxProvisionedPackage -Online
$Apps | Where-Object {$_.DisplayName -like "*windowscommun*"} | Remove-AppxProvisionedPackage -Online
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Olaf I will try this version too.
This answer is correct because of the difference between Get-AppxProvisionedPackage and Get-AppxPackage. AppxPackage get packages that are already installed, AppxProvisionedPackage gets packages in the repository. If it's a freshly image before anyone logs in then you can just use AppxProvisionedPackage, but if users have logged in both will need to be used.
-1

You've got the -AllUsers switch set on Get-AppxPackage, but not on Remove-AppxPackage. If you do add it to the end of each line, you should get the expected behavior. Note that I don't think you need the first AllUsers switch, but it can't hurt to keep it in (excluding that it'll probably make the commands take longer to complete.)

Get-AppxPackage -AllUsers | where-object {$_.name –like “*3DBuilder*”} | Remove-AppxPackage -AllUsers

3 Comments

There is no -AllUsers paramter with Remove-AppxPackage
Thanks for the feedback, i will try adding that to my script now :)
@OlafReitz it didn't in Windows 8, but it certainly does in Windows 10: technet.microsoft.com/en-us/itpro/powershell/windows/appx/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.