question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Appx module no longer imports in Powershell Core

See original GitHub issue

Steps to reproduce

Import-Module Appx

Expected behavior

Successfully imports & can run Add-AppxPackage etc. This worked in 7.0.3, but now forces me to switch to Windows Powershell for some scripts.

Actual behavior

Import-Module: Operation is not supported on this platform. (0x80131539)

Environment data

Name                           Value
----                           -----
PSVersion                      7.1.0
PSEdition                      Core
GitCommitId                    7.1.0
OS                             Microsoft Windows 10.0.19041
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
doctordnscommented, Nov 12, 2020

The APPX module can be loaded like this:

Import-Module -Name Appx -UseWIndowsPowershell
2reactions
samus-acommented, Nov 22, 2021

PowerShell 7.2 (Windows 11):

PS > Import-Module -Name Appx -UseWIndowsPowershell
WARNING: Module Appx is loaded in Windows PowerShell using WinPSCompatSession remoting session; please note that all input and output of commands from this module will be deserialized objects. If you want to load this module into PowerShell please use 'Import-Module -SkipEditionCheck' syntax.
Read more comments on GitHub >

github_iconTop Results From Across the Web

PowerShell Core and AppX package management
Reading the blog post, this seems a bit safer than importing a Windows module (e.g. AppX ) from PowerShell Core, since among other...
Read more >
Import-Module (Microsoft.PowerShell.Core)
The Import-Module cmdlet adds one or more modules to the current session. ... This feature lets you use cmdlets that are implemented in...
Read more >
Get-Module (Microsoft.PowerShell.Core)
The Get-Module cmdlet lists the PowerShell modules that have been imported, or that can be imported, into a PowerShell session. Without parameters ...
Read more >
Powershell Function App fails to import module
The function app now fails when loading the Powershell Module (MSOnline) using the Import-Module cmdlet, like this:.
Read more >
about Modules - PowerShell
Explains how to install, import, and use PowerShell modules.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found