Get-AppxPackage Throws Error

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 1 month and 4 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
gbmacman2
Posts: 4
Last visit: Fri Sep 27, 2024 12:05 pm

Get-AppxPackage Throws Error

Post by gbmacman2 »

I cant say if this issue exists in all 24H2, but I patched my installed preview release this morning (KB5041571) and this doesn't work inside PS Studio. This command works perfectly in Terminal and PowerShell ISE. NOT related, but winget hangs on confirmation if never run before (also works in terminal or PS ISE).

Product: PowerShell Studio 2024 (64 Bit)
Build: v5.8.248
OS: Windows 11.0.26100.1457 (Release Preview 24H2 Enterprise)
PS Version(s): 5.1.26100.1, 7.4.5
  1. Get-AppxPackage -AllUsers | Sort-Object -Unique | Select-Object Name
>> Running (Untitled) Script Selection...
>> Platform: V5 64Bit (STA) (Elevated)
ERROR: Get-AppxPackage : The type initializer for '<Module>' threw an exception.
ERROR: At Line: 15 char: 1
ERROR: + Get-AppxPackage -AllUsers | Sort-Object -Unique | Select-Object Name
ERROR: + ~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : NotSpecified: (:) [], TypeInitializationException
ERROR: + FullyQualifiedErrorId : System.TypeInitializationException
ERROR:

*** PowerShell Script finished. ***
>> Execution time: 00:00:02
>> Script Ended
>> Copied to clipboard.
User avatar
brittneyr
Site Admin
Posts: 1807
Last visit: Wed Nov 13, 2024 7:37 am
Answers: 44
Been upvoted: 34 times

Re: Get-AppxPackage Throws Error

Post by brittneyr »

Preview versions of Windows are not supported and therefore are not tested with our products. Only official Windows releases are subject to support.

The error message is from the command, not PowerShell Studio. We do not have any control over WinGet.
Brittney
SAPIEN Technologies, Inc.
This topic is 1 month and 4 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.