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)?
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.