Categories
Microsoft PowerShell

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

I was running a command to install a PowerShell module, e.g.

Install-Module -Name navcontainerhelper -Force

while I received the following error message:

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

Solution:

Run PowerShell as Administrator and run the following command to force to use TLS1.2 protocol

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

Did my solution solve your problem? Leave a reply.

11 replies on “Unable to resolve package source ‘https://www.powershellgallery.com/api/v2’”

This was exactly what I needed, thanks so much!!! The answer was so straightforward I wasn’t really sure this has much “substance” (no offense intended) but the solution really was that precise and effective, so thank you very much for posting this!! Cheers

Hi Chris,

I’m happy that I was able to help you through my website. Yes, my goal is to provide a working solution to the error messages I received in my daily experience working in IT.
Your message is really appreciated because give me the motivation to continue writiing new posts.

Thank you

Not solve for me.

I receive the erro when execute the command ” invoke-command -ComputerName $computer -ScriptBlock {install-module pswindowsupdate -force}” and setting the $computer to the local hostname, but if i run “install-module pswindowsupdate -force” directly I dont receive the error.

Hi,

Actually I had an issue with an integration in NAV that suddenly stopped working and the solution was to enable use TLS 1.2
I applied the same solution here and it worked.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.