WARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2'
This post describes how I resolved the following:
WARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2'
Cause
This warning can occur when trying to install a PowerShell module and Tls12 is not specified as the SecurityProtocol.
You can check the SecurityProtocol by running this command in PowerShell:
[Net.ServicePointManager]::SecurityProtocol
Resolution
To resolve this issue, I set the SecurityProtocol to Tls12 by running this command in PowerShell:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Source: https://rnelson0.com/2018/05/17/powershell-in-a-post-tls1-1-world/
I was then able to install PowerShell modules successfully.
Related Posts
- Get-PSGalleryApiAvailability : PowerShell Gallery is currently unavailable. Please try again later.

![[Net.ServicePointManager]::SecurityProtocol](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDmAa-mnJgMjsWDHGRxBTd9j4qwMlqzd4_eNwNRtkNml4QQRGwI6XjYob_h49Pf_tmSUtqGG_OHcEF2TpCufBpUauUdq-f2UpFVjgQDaaWWEMfkMGa9cCqQQZ_vjznJo6UZZeyJDdxM93x/s16000-rw/net-servicepointmanager-securityprotocol.png)
![[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXX0a9UKcD-rkUH9jZeG8KxRd8ZWoN2K57H7afzDrHJ2YJOX22gXO_I6R0blN_x5dpiLSpp-wSPImYQLeWG4f0jNS9cBziUegLRHvj-ca7Vi_z6jL0atheGMrz-lkM0oQsBQTlAj8d0UWu/s16000-rw/net-servicepointmanager-securityprotocol-tls12.png)

Comments
Post a Comment