Skip to content

Conversation

@theCrius
Copy link

Running the application in modern system or with a system that have PowerShell 7.x installed as default, will generate an error when trying to list the games.

This change will simply run the exact same logic, but first check what PowerShell is running into. If it's in PowerShell 7.x, it will instead explicitly invoke PowerShell 5.x to maintain the functionality.

You can easily test this by:

  1. Download the current master branch of the project
  2. Open Powershell 7.x
  3. Copy and paste your absolute path to UWPHook\Resources\GetAUMIDScript.ps1 and run

You'll see this error:

Line |
   1 |  $installedapps = get-AppxPackage
     |  ~~~~~~~~~~~~~~~
     | The term '$installedapps' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
     | again.

If you instead try to run the version I have updated, you'll see the list of games retrieved. For example:

Microsoft Edge|C:\Program Files\WindowsApps\Microsoft.MicrosoftEdge.Stable_131.0.2903.112_neutral__8wekyb3d8bbwe\Logo.png|Microsoft.MicrosoftEdge.Stable_8wekyb3d8bbwe!App|msedge_proxy.exe;
Realtek Audio Control|C:\Program Files\WindowsApps\RealtekSemiconductorCorp.RealtekAudioControl_1.51.347.0_x64__dt26b99r8h8gj\Assets\Square150x150Logo.png|RealtekSemiconductorCorp.RealtekAudioControl_dt26b99r8h8gj!App|RtkUWP.exe;
Xbox Game Bar Plugin|C:\Program Files\WindowsApps\Microsoft.XboxGameOverlay_1.54.4001.0_x64__8wekyb3d8bbwe\Assets\GamesXboxHubMedTile.png|Microsoft.XboxGameOverlay_8wekyb3d8bbwe!App|GameBar.exe;
Xbox TCUI|C:\Program Files\WindowsApps\Microsoft.Xbox.TCUI_1.24.10001.0_x64__8wekyb3d8bbwe\Assets\MediumTile.png|Microsoft.Xbox.TCUI_8wekyb3d8bbwe!Microsoft.Xbox.TCUI|TCUI-App.exe;
Cortana|C:\Program Files\WindowsApps\Microsoft.549981C3F5F10_4.2308.1005.0_x64__8wekyb3d8bbwe\Assets\Store\Square150x150Logo.png|Microsoft.549981C3F5F10_8wekyb3d8bbwe!App|Cortana.exe;
UDK Package|C:\Windows\SystemApps\MicrosoftWindows.UndockedDevKit_cw5n1h2txyewy\Assets\Logo.png|MicrosoftWindows.UndockedDevKit_cw5n1h2txyewy!App|UndockedDevKit.exe;
NcsiUwpApp|C:\Windows\SystemApps\NcsiUwpApp_8wekyb3d8bbwe\Assets\1X1.png|NcsiUwpApp_8wekyb3d8bbwe!App|NcsiUwpApp.exe;
PinningConfirmationDialog|C:\Windows\SystemApps\Microsoft.Windows.PinningConfirmationDialog_cw5n1h2txyewy\Assets\Logo.png|Microsoft.Windows.PinningConfirmationDialog_cw5n1h2txyewy!App|PinningConfirmationDialog.exe;
CapturePicker|C:\Windows\SystemApps\Microsoft.Windows.CapturePicker_cw5n1h2txyewy\Assets\Logo.png|Microsoft.Windows.CapturePicker_cw5n1h2txyewy!App|CapturePicker.exe;
AMD Radeon Software|C:\Program Files\WindowsApps\AdvancedMicroDevicesInc-2.AMDRadeonSoftware_10.24.10035.0_x64__0a9344xs7nr4m\Assets\Square150x150Logo.png|AdvancedMicroDevicesInc-2.AMDRadeonSoftware_0a9344xs7nr4m!AMDRadeonsoftwareUWP|radeonsoftware\radeonsoftware.exe;
OfficePushNotificationsUtility|C:\Program Files\WindowsApps\Microsoft.OfficePushNotificationUtility_16.0.18623.20156_neutral__8wekyb3d8bbwe\Assets\Square150x150Logo.png|Microsoft.OfficePushNotificationUtility_8wekyb3d8bbwe!OPushUtil|OPushUtil.exe;
Microsoft Defender|C:\Program Files\WindowsApps\Microsoft.6365217CE6EB4_102.2502.5001.0_x64__8wekyb3d8bbwe\Images\Square150x150Logo.png|Microsoft.6365217CE6EB4_8wekyb3d8bbwe!App|MicrosoftSecurityApp\MicrosoftSecurityApp.exe;
OneNote for Windows 10|C:\Program Files\WindowsApps\Microsoft.Office.OneNote_16001.14326.22348.0_x64__8wekyb3d8bbwe\images\OneNoteMediumTile.png|Microsoft.Office.OneNote_8wekyb3d8bbwe!microsoft.onenoteim|onenoteim.exe;
Skype|C:\Program Files\WindowsApps\Microsoft.SkypeApp_15.150.3125.0_x64__kzf8qxf38zg5c\Assets\SkypeMedTile.png|Microsoft.SkypeApp_kzf8qxf38zg5c!App|Skype\Skype.exe;
Grounded|C:\Program Files\WindowsApps\Microsoft.Maine_2.4.438.0_x64__8wekyb3d8bbwe\Resources\Logo.png|Microsoft.Maine_8wekyb3d8bbwe!AppGroundedShipping|Maine\Binaries\WinGDK\Maine-WinGDK-Shipping.exe;
Ubuntu|C:\Program Files\WindowsApps\CanonicalGroupLimited.Ubuntu_2404.1.68.0_x64__79rhkp1fndgsc\Assets\Square150x150Logo.png|CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc!ubuntu|ubuntu.exe;
Game Bar|C:\Program Files\WindowsApps\Microsoft.XboxGamingOverlay_7.325.5191.0_x64__8wekyb3d8bbwe\Assets\GameBar_MedTile.png|Microsoft.XboxGamingOverlay_8wekyb3d8bbwe!App|GameBar.exe;
NVIDIA Control Panel|C:\Program Files\WindowsApps\NVIDIACorp.NVIDIAControlPanel_8.1.968.0_x64__56jybvy8sckqj\Assets\Square150x150Logo.png|NVIDIACorp.NVIDIAControlPanel_56jybvy8sckqj!NVIDIACorp.NVIDIAControlPanel|nvcplui.exe;
Microsoft Teams|C:\Program Files\WindowsApps\MSTeams_25163.3611.3774.6315_x64__8wekyb3d8bbwe\Images\TeamsForWorkNewStoreLogo.scale-150.png Images\TeamsForWorkNewStoreLogo.scale-150.png Images\TeamsForWorkNewMedTile.png Images\TeamsForWorkNewMedTile.png|MSTeams_8wekyb3d8bbwe!MSTeamsRemoteModuleContainer|ms-teams.exe;
Outlook for Windows|C:\Program Files\WindowsApps\Microsoft.OutlookForWindows_1.2025.702.0_x64__8wekyb3d8bbwe\Assets\MedTile.png|Microsoft.OutlookForWindows_8wekyb3d8bbwe!Microsoft.OutlookforWindows|olk.exe;
Microsoft Store|C:\Program Files\WindowsApps\Microsoft.WindowsStore_22506.1401.7.0_x64__8wekyb3d8bbwe\Assets\AppTiles\StoreMedTile.png Assets\AppTiles\StoreMedTile.png|Microsoft.WindowsStore_8wekyb3d8bbwe!App|WinStore.DesktopExtension\StoreDesktopExtension.exe;
Copilot|C:\Program Files\WindowsApps\Microsoft.Copilot_1.25064.139.0_x64__8wekyb3d8bbwe\Assets\Square150x150Logo.png|Microsoft.Copilot_8wekyb3d8bbwe!App|Copilot.exe;
OUTRIDERS|C:\Program Files\WindowsApps\39C668CD.Madness-BaseGame_17.2208.190.0_x64__r7bfsmp40f67j\Resources\Logo.png|39C668CD.Madness-BaseGame_r7bfsmp40f67j!AppOutridersShipping|Madness\Binaries\WinGDK\Madness-WinGDK-Shipping.exe;
Microsoft 365 Copilot|C:\Program Files\WindowsApps\Microsoft.MicrosoftOfficeHub_19.2507.46151.0_x64__8wekyb3d8bbwe\images\Square150x150Logo.png|Microsoft.MicrosoftOfficeHub_8wekyb3d8bbwe!Microsoft.MicrosoftOfficeHub|WebViewHost.exe;
WhatsApp|C:\Program Files\WindowsApps\5319275A.WhatsAppDesktop_2.2528.4.0_x64__cv1g1gvanyjgm\Images\System\MedTile.png|5319275A.WhatsAppDesktop_cv1g1gvanyjgm!App|WhatsApp.exe;

Which I assume is the expected result.

theCrius added 2 commits July 20, 2025 16:11
…powershell-5-to-avoid-compatibility-issues

Ensure the Appx module is run via powershell 5
@andres-asm
Copy link

With this is it working again?

@theCrius
Copy link
Author

theCrius commented Oct 11, 2025

I assume so, I can't recall the extent of my testing as it's been too long ago.
I was waiting for someone to test and approve the merge request.

The code change is really simple: everything in the script is put into a function and if the powershell version on the system is detected to be 7 or higher, the function is instead run using powershell 5. If not, it's run as is.

Probably easier to read the change in diff view rather than the default inline view.

https://github.com/BrianLima/UWPHook/pull/172/files?diff=split&w=0

The output I wrote above is by calling directly the script. Which, in the current version, simply fail to execute instead.
I seem to recall other issues but the script not running under powershell 7 was certainly one of them, and this merge request fixes that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants