首页 > 技术文章 > Windows Powershell安装错误

qishine 2021-02-21 16:18 原文

今天需要更新一下VMware的 powercli。使用命令install-module -Name VMware.PowerCLI -AllowClobber但是遇到一个错误。

Unable to resolve package source 'https://www.powershellgallery.com/api/v2'

无法解析安装源?这个似乎有点奇挂,官方的地址不能解析这个可能性不大啊。

经过一番搜索,有人抓包后发现是客户端和服务通信用了TLS 1.0。我们可以强制powershell使用TLS1.2进行通信。

输入以下命令后,再安装就没问题了。

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

推荐阅读