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

Screenshot showing error Get-PSGalleryApiAvailability : PowerShell Gallery is currently unavailable.  Please try again later.


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

Install Security Protocol Type 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'

- PackageManagement\Install-Package : No match was found for the specified search criteria and module name

- WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.

Comments

Popular posts from this blog

LG TV This app will now restart to free up more memory

LG TV Clear All Browsing History Data

Excel Import CSV not using "Use First Row as Headers"