Update-Module VMware.PowerCLI – Unable to find repository


On one of my development machines (old school Windows 2012 R2 with PowerShell 5.1) I tried to upgrade the VMware.PowerCLI module to the latest version. But this time it was not just type the “update-module VMware.PowerCLI” command and you’re ready. Instead I received the following error:

Unable to find repository ‘https://www.powershellgallery.com/api/v2′. Use Get-PSRepository to see all available repositories.

image

I remembered this post from Przemyslaw Klys describing the same issue. Recently PowerShellGallery disabled support for TLS 1.0 and is now requiring TLS 1.2 So you have to enable TLS 1.2 support on your “old” servers.

The quick fix, if you want to enable TLS 1.2 for the current PowerShell session is to run the following command:

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

After enabling TLS 1.2 it’s time to upgrade to the latest version of the VMware.PowerCLI module.

Or you can just enable TLS 1.2 on your system by checking this guide from Microsoft.

– Happy scripting –