今天需要更新一下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