PowerShell and Get-AppXPackage

britechguy

Well-Known Member
Reaction score
4,041
Location
Staunton, VA
First, let me state at the outset that I am not well-versed in PowerShell. I still use Command Prompt under Windows 10 far more frequently than PowerShell, but I have written some PowerShell scripts.

I have recently noticed a lot of people posting that they cannot get Get-AppXPackage to work and are getting error messages. That's true for me, as well, if I try it in one of the later versions of PowerShell that I downloaded (MSI installer) from the location specified by Microsoft. Here's the output after I did a command to display the current path and then tried Get-AppXPackage in PowerShell v7:

PS_V7.png

This is what I get If I use Version 1.0 that shipped with Windows 10 way back when:

PS_v1.0.png

Does anyone know why Get-AppXPackage does not work in Version 7 as installed? Do you know how to fix it (as trying what PowerShell recommended doesn't seem to work)?

I would think that PowerShell, in whatever version, would be a "ready to go upon install" kind of thing, not something you need to assemble.

Brian
 
With .Net 5, dotnet no longer has any knowledge of WinRT built in. Instead there is a generic wrapper than can be used, but the AppX module need to be recompiled to use it. It seems like the current workaround it to import it adding the -UseWindowsPowershell switch.

I know teams are swamped with Windows 11 stuff, so that's probably why it's not prioritized at the moment.
 
With .Net 5, dotnet no longer has any knowledge of WinRT built in. Instead there is a generic wrapper than can be used, but the AppX module need to be recompiled to use it. It seems like the current workaround it to import it adding the -UseWindowsPowershell switch.

I know teams are swamped with Windows 11 stuff, so that's probably why it's not prioritized at the moment.
You can think of WinRT as one interface that is used to expose the Windows APIs
 
Back
Top