PwrShell: Remove-AppxPackage & Remove-AppxProvisionedPackage -AllUsers


  1. Posts : 36
    Windows 10 Home 19044 64-bit
       #1

    PwrShell: Remove-AppxPackage & Remove-AppxProvisionedPackage -AllUsers


    Hello,
    I would like to ask a couple of questions regarding PowerShell commands for App management (OS build 19041.450)

    First: is there any difference between
    Get-AppxPackage *Microsoft.XboxApp* | Remove-AppxPackage
    and
    Get-AppxPackage -AllUsers *Microsoft.XboxApp* | Remove-AppxPackage
    if there is only one user on the computer?

    Second: what is the difference between
    Remove-AppxProvisionedPackage -Online -PackageName MyAppxPkg
    and
    Remove-AppxProvisionedPackage -AllUsers -Online -PackageName MyAppxPkg

    Thanks for any help,
    Mark
    Last edited by Mark0; 31 Aug 2020 at 08:49. Reason: typo
      My Computer


  2. Posts : 2,544
    Windows 10 Pro 64bit
       #2

    The first cmd would install or remove the app just for the currently logged in user whereas the second would install/remove the app for all users on the PC.
    If there’s only 1 user then the first cmd is fine.
      My Computer


  3. Posts : 36
    Windows 10 Home 19044 64-bit
    Thread Starter
       #3

    Bastet said:
    The first cmd would install or remove the app just for the currently logged in user whereas the second would install/remove the app for all users on the PC.
    If there’s only 1 user then the first cmd is fine.
    Hi,
    as for my first question: in a single-user scenario, would the package under %ProgramFiles%\WindowsApps get removed both with and without the -AllUsers parameter?
    If talking about provisioned apps, any difference for newly created users?
    As regarding the second question: could you help explaining the meaning of -AllUsers for the Remove-AppxProvisionedPackage cmdlet?
    Cheers,
    Mark
      My Computer


  4. Posts : 2,544
    Windows 10 Pro 64bit
       #4

    Yes it would.
    Don’t know that one.
    All users just refers to all the user accounts which are on the PC.

    I’m sure someone will have a more detailed response.
      My Computer


  5. Posts : 36
    Windows 10 Home 19044 64-bit
    Thread Starter
       #5

    Bastet said:
    All users just refers to all the user accounts which are on the PC.
    Right.
    The meaning of -AllUsers is clear for the Remove-AppxPackage cmdlet, which uninstalls the package on a per-user basis.

    On the other hand, Remove-AppxProvisionedPackage works on provisioned packages in a Windows image and does not affect existing user accounts. The MS doc page doesn't help, either:
    https://docs.microsoft.com/en-us/pow...-ps#parameters
      My Computer


  6. Posts : 2,544
    Windows 10 Pro 64bit
       #6

    Microsoft’s help pages on occasion aren’t very helpful.
      My Computer


  7. Posts : 36
    Windows 10 Home 19044 64-bit
    Thread Starter
       #7

    Bastet said:
    Yes it would.
    Little update: even in the case of a single user, adding -AllUsers to Remove-AppxPackage does make a difference. I've been testing it for the last weeks, and this is what I see:
    Completely uninstall provisioned apps: how-to and detailed explanation
    Cheers,
    Mark
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:26.
Find Us




Windows 10 Forums