r/PowerShell • u/fuckAraZobayan • May 05 '26
Question cannot re-enable Microsoft Store via Get-AppxPackage command in powershell via script....
Here is the powershell command I am trying to execute:
Get-AppxPackage -AllUsers Microsoft.WindowsStore* | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
On my previous Windows install this worked perfect so I could Uninstall and reinstall the Microsoft Store at will and make sure it wasn't running in the background, But with my Windows install I'm getting this error:
"Add-AppxPackage : Cannot find path 'C:\AppXManifest.xml' because it does not exist."
I have never seen this error before, Any idea how to fix this? Basically I just want to reinstall the Microsoft Store. I don't care if it's via a Powershell command or script a batch script or an exe, Whatever works works.
Thanks in advance!!
View all comments
Show parent comment
1
u/dodexahedron May 05 '26
Winget is great. The powershell module for it also makes scripting it a lot simpler, if you prefer, or if you need to use winget in the system context (e.g. from a scheduled task).
In any case, for winget:
Just in case your sources are all messed up, reset them first, or at least look at them to find out.
winget source listwill list the currently configured sources.winget source reset --forcewill bring back msstore and winget sources, and remove custom ones.winget source updateafter that will make sure they're current (they already should be after a reset, but that might not be true forever).Amotjer bonus: winget can manage msstore apps and winget apps, but the store can only manage store apps. If you want to do things via automation, use intune, group policy, or winget.
There are graphical front-ends available for it, too, if uou want a friendly user experience plus the flexibility. UniGetUI is probably the msot popular one. 🤷♂️