Update-AppxPackage....where is it?

hi, i am trying to update my Microsoft Store Apps using powershell. Several different sources like this: https://powershellcommands.com/update-windows-store-apps-powershell show simple code like this:

Get-AppxPackage | ForEach-Object { Update-AppxPackage -Package $_.PackageFullName }

the problem is that although get-appxpackage works fine, update-appxpackage throws an error…there seems to be no update-appxpackage commandlet installed on any system i have and moreover, i cannot find any documentation for this command anywhere..

am i crazy? where is this a real command, or are all these sites written by AI and just hallucinating??

thanks in advance

This isn’t something I’ve had to do so I’m approaching this objectively from a PowerShell perspective.
AppX is a binary module available only in Windows PowerShell.
The article you linked to appears to be an AI generated website so I suspect that the AI hallucinated the Update-AppxPackage cmdlet as it truly does not exist.

get-command -Module Appx | Where-Object {$_.Name -match 'update'}

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Alias           Get-AppPackageAutoUpdateSettings                   2.0.1.0    appx
Alias           Remove-AppPackageAutoUpdateSettings                2.0.1.0    appx
Alias           Set-AppPackageAutoUpdateSettings                   2.0.1.0    appx
Cmdlet          Get-AppxPackageAutoUpdateSettings                  2.0.1.0    appx
Cmdlet          Remove-AppxPackageAutoUpdateSettings               2.0.1.0    appx
Cmdlet          Set-AppxPackageAutoUpdateSettings                  2.0.1.0    appx

Just another example of AI leading people astray. A quick search of the internet is not revealing a lot of options for directly updating Windows Store apps via PowerShell.
There’s some references about using WMI, and another one that talks about starting the ‘ms-appx://’ process with arguments, but I’m not seeing PowerShell cmdlets directly related to it.

1 Like

yeh, i am thinking that is the case…it is close, there is a get-appxpackage command ( Get-AppxPackage (Appx) | Microsoft Learn but i am thinking update-appxpackage is a hallucination.

any idea how to accomplish what update-appxpackage should be doing? i can start a new thread for that

You could use winget to update not only MS Store Apps. But why do you want to update Store Apps with PowerShell? Normally, MS Store Apps are automatically updated by… MS Store… Our users don’t have access to the MS Store, but installed Apps are being updated by the Store.

You may read the other thread …

Samuel, i am open to using winget, but i am not very familiar with it. can i use it to update store apps of all the user profiles on a computer? do you have examples?
thanks

# Set execution policy (if needed)
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force

# Install Microsoft Whiteboard silently
winget install --id 9MSPC6MP8FM4 --silent --accept-package-agreements --accept-source-agreements

#Check if Whiteboard is installed
winget list --name "Whiteboard"

The hardest part is to find the id of the package. This can be done by listing all installed packages on a device where the package is already installed via

winget list

In our environment, the winget script runs in user context and therefore updates only the app of the corresponding user profile. I’m not sure if winget is capable of updating apps for all profiles.

consider removing unused profile on a regular base. We use a script that removes user profiles older than x days based on a timestamp written at logon of a user. There is also a GPO that does the same, unfortunately it is broken since years and MS seems not willing to fix it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.