您好,
欢迎在Q&A论坛发帖。
我查了一下,看到有人提到在Windows 10上PowerShell从7.1版本就开始存在这个问题了。
https://github.com/PowerShell/PowerShell/issues/13138
我在Windows 10环境里试了一下,PowerShell 7.0是可以正常加载Appx模块的,但是从7.1到最新的7.4都存在同样的问题。
要在Windows 10使用Appx模块,只能是在PowerShell 7中Import-Module加载模块时使用-UseWindowsPowerShell启用Windows PowerShell兼容性功能,或者直接使用Windows 10自带的Windows PowerShell 5.1。
祝好
Ian Xue
如果回复有帮助,请帮忙点击 "接受答案"。