首页 > 解决方案 > Get-PSRepository 命令通过两个 Powershell ISE 提供两个输出

问题描述

当我使用 Powershell ISE(x86) 运行 Get-PSRepository 时,它向我显示了受信任的源位置和安装策略。它显示的源位置是https://www.powershellgallery.com/api/v2

但是当我在没有 x86 的情况下使用 Powershell ISE 运行相同的命令时,我收到以下错误:

Get-PSRepository:在模块“PowerShellGet”中找到“Get-PSRepository”命令,但无法加载该模块。有关详细信息,请运行“导入模块 PowerShellGet”。在 line:1 char:1 + Get-PSRepository + ~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-PSRepository:String) [], CommandNotFoundException + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule

为什么powershell使用两个不同的ISE显示两种行为是因为环境变量还是什么?

标签: powershellpowershell-5.0

解决方案


推荐阅读