Reputation: 2175
I want to uninstall all of the apps preinstalled on windows without uninstalling those apps that I installed. I know that I can specify the apps by name, but I want to run this script without manually update it when I install an app.
My script looks like this
Get-AppxPackage -allusers | where-object {$_.name –notlike "*store*"} | where-object {$_.name –notlike "*calculator*"} | where-object {$_.name –notlike "*terminal*"} | where-object {$_.name –notlike "*winget*"} | where-object {$_.name –notlike "*DesktopAppInstaller*"} | where-object {$_.name –notlike "*Microsoft.VCLibs.140.00.UWPDesktop*"} | where-object {$_.name –notlike "*DesktopAppInstaller*"} | Remove-AppxPackage
I can change it to always uninstall the apps that I don't want to keep on my windows installation like this:
get-appxpackage -allusers *3dbuilder* | remove-appxpackage
get-appxpackage -allusers *alarms* | remove-appxpackage
get-appxpackage -allusers *appconnector* | remove-appxpackage
However this is quite manually as well, as long windows keep adding other crappy apps I still need to find and add it to my list.
Can I in some way find what apps that where manually installed by the user? Either by an installation file or with winget. Or do I need to make a program that I install my apps trough that saves the the id of the installed app (that is if they were installed with winget)?
Upvotes: 1
Views: 1127
Reputation: 1194
I published a tool to remove the preinstalled applications on Windows 10/11.
You can have a look on Github, here.
You can execute it and it will prompt you which app you want to remove. I have been using it for some time, it is quite easy and fast. Nevertheless for the moments, that only removes app for the current user, but if you know how to fix this you can edit it.
Download it and then execute it like so:
.\remove_preinstalled_apps.ps1
If you get an Error
, you may need to edit your execution policy:
Set-ExecutionPolicy RemoteSigned
I hope it helps
I added a version for removing apps system wide with -AllUsers
but it stills need to be tested, so it is on a separate branch for the moment (see PR).
Upvotes: 0
Reputation: 1248
The Windows Package Manager (as of today 10/7/2021) doesn't record what it installed on the system. There is work to add this in the future, but in the current state there is no way to know the source for app installation.
Upvotes: 1