Get-PSGalleryApiAvailability : PowerShell Gallery is currently unavailable. Please try again later.
This post describes how to fix the error:
Get-PSGalleryApiAvailability : PowerShell Gallery is currently unavailable. Please try again later.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:4264 char:9
+ Get-PSGalleryApiAvailability -Repository $Name
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-PSGalleryApiAvailability], InvalidOperationException
+ FullyQualifiedErrorId : PowerShellGalleryUnavailable,Get-PSGalleryApiAvailability
Cause
This error can occur when trying to set a value for a registered module repository 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, set the SecurityProtocol to Tls12 by running this command in PowerShell:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
You should then be able to set values for module repositories and install PowerShell modules successfully.
Related Posts
- WARNING: Unable to resolve package source 'https //www.powershellgallery.com/api/v2'
Comments
Post a Comment