PowerShell – WARNING: Unable to resolve package source ‘https://www.powershellgallery.com/api/v2’.

I was going to update the PowerCLI module to version 12.5 once I received the above error. The first thing I was going to try was to upgrade the PowerShellGet version. This resulted in the same error.

To solve this issue we need to force PowerShell to use TLS 1.2 at least. To do so we need to run this command:

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

There is no output after running the command. To make sure “the fix” was successful, run this command:

Find-Module PSWindowsUpdate

And after fixing PowerShell Gallery issue installation of PowerCLI and rest of VMware modules went through

Please like and share to spread the knowledge in the community.

If you want to chat with me please use Twitter: @AngrySysOps

Visit my FB page: https://www.facebook.com/AngrySysOps

Read my blog: https://angrysysops.com

Subscribe to my channel : https://www.youtube.com/channel/UCRTcKGl0neismSRpDMK_M4A

Please leave the comment