运行以下设置:
尝试安装 posh-git 模块给出:
PowerShellGet\Install-Module posh-git -Scope CurrentUser
但是得到
PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'posh-git'.
尝试
Get-PackageSource
时和 Get-PSRepository
我明白了WARNING: Unable to find package sources
和
WARNING: Unable to find module repositories.
我坐在 TMG 代理后面并尝试使用
-Proxy
切换和设置设置 winttp 代理没有运气。
最佳答案
根据 Keith Hill 的建议,手动添加 PowerShellGallery 存储库:
Register-PSRepository -Name PSGallery -SourceLocation https://www.powershellgallery.com/api/v2
我在使用 -proxy 开关时遇到了麻烦,所以我通过 netsh 设置了代理,这可以解决问题:
netsh winhttp set proxy proxy-server="http=myproxy:8080"
关于git - 安装模块的代理问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42239705/