How can I reinstall or re-register Microsoft Store with PowerShell?
Asked by
VelvetCactus42
I'm trying to restore Microsoft Store with this PowerShell command:
Get-AppxPackage -AllUsers Microsoft.WindowsStore* | ForEach-Object { Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)AppXManifest.xml" }
This worked on a previous Windows installation, but now it fails with: "Cannot find path 'C:AppXManifest.xml' because it does not exist." I'd like to reinstall or re-enable Microsoft Store by any reliable method, whether that's PowerShell, a batch command, or another built-in tool. What is causing the missing path, and what should I try?
Answers
Try resetting or reinstalling the Store with the built-in installer instead of registering a package whose InstallLocation may be empty. Run `wsreset.exe -i`, then wait for the installation to finish. If winget is available, you can also try installing Microsoft Store from the Microsoft Store source.
Reply to this answer
The error means the pipeline is reaching Add-AppxPackage with an empty or invalid InstallLocation, so it constructs `C:AppXManifest.xml`. Run the commands separately to confirm whether Get-AppxPackage actually finds a Microsoft Store package. If it returns nothing, there is no package available to re-register, and youโll need to reset or reinstall the Store rather than use Add-AppxPackage directly.
Reply to this answer
If the Store was removed with a third-party uninstall utility, the original package may no longer be present for all users. In that case, re-registering cannot work until the package is restored; use `wsreset.exe -i` or a working package installer instead.
Reply to this answer
Add your answer
Answers are reviewed before publication.
PineEcho19: The command Iโve used is `wsreset.exe -i`. On systems where winget is working, installing the Microsoft Store package from the Microsoft Store source can also restore it.