How to uninstall an app that another user installed? How to uninstall an app that another user installed? powershell powershell

How to uninstall an app that another user installed?


My process above still works, but it simply gets around a race condition issue, where Windows Update (yes, oddly enough) is in charge of wiping out "staged packages."

According to Microsoft, the "other fix" - and I still consider this issue to be a bug - is:

Cause of the problem:

Windows Update (WU) downloads newer versions of packages you have and “stages” them as Local System, so that when you go to the store to update the apps, the update process is as quick as possible. WU will eventually clean up the staged packages that were never installed.

What are some consequences of having "Staged" packages?

  1. Staged packages prevent you from installing that particular package in development mode

  2. Staged packages eat up some disk space, but due to hardlinking, the effect of this is mitigated. If a file is identical between multiple versions of a package, appx deployment hardlinks the files instead of maintaining two separate copies of the same file.

How do I find the "Staged" packages?

  1. In an administrator powershell prompt, the command:

    get-appxpackage -all

will display all packages on the machine. For a staged package, the PackageUserInformation will show {S-1-5-18 [Unknown user]: Staged} 2. Using powershell filtering, to get the list of all staged packagefullnames, you could do:

get-appxpackage -all |% {if ($_.packageuserinformation.installstate -eq "Staged"){$_.packagefullname}}

How do I get rid of the "Staged" packages?

  1. Download psexec from sysinternals tools, written by Mark Russinovich

  2. To get rid of all of them, run in a regular admin/elevated command prompt (not powershell):

psexec -s powershell -c "get-appxpackage | remove-appxpackage"


If that doesn't work, you can also try the following, which worked for me. Note that this is for my dev machine, not a regular user's machine, so I don't know how it would affect non-devs :-P

  1. Take ownership of the folders c:\Program Files\WindowsApps and C:\ProgramData\Microsoft\Windows\AppRepository - giving Administrator full access. Make sure TrustedInstaller also has Modify rights as well. You're also taking ownership. If you're unawares, this is done via the Properties on that folder.

  2. Go to Services and stop the Windows Installer service.

  3. Open C:\ProgramData\Microsoft\Windows\AppRepository\ and delete the PackageRepository.edb file.

  4. Start the Windows Installer service again.

  5. Launch Visual Studio as Administrator.

  6. Attempt to launch your app. It should work.

After you run the app once you should be able to run VS in user mode again.


There was an improvement in Windows 10 1709 to the remove-appxpackage cmdlet, adding -allusers as an option.

So, to uninstall an App for all users, this command works:

Get-AppxPackage -AllUsers [PackageFamilyName] | Remove-AppxPackage -AllUsers

Where [PackageFamilyName] is generally the GUID of your package.

Caveat / Caution: The command seems to make re-installation (re-provisioning the package using DISM) later very difficult, as it seems to treat is as if each user individually uninstalled the app. Too much to get into here...