Open ghousebaig7in opened 2 years ago
Hi, are you using TLS version 1.2?
Try running [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
and then running Get-PSGalleryApiAvailability -Repository $Name
for more info see: https://devblogs.microsoft.com/powershell/powershell-gallery-tls-support/
@alerickson, thanks for your reply. Yes, I did used TLS 1.2 and ran the command that you suggested. But didnt help 😞
Are you still having this issue @ghousebaig7in? If so can you include more details on your PowerShell version?
same issue, using TLS 1.2 and powershell 5.1
Having the same issue, a resolution to this seemingly impossible to fix issue would be fantastic. I've been attempting to solve this on and off for weeks, and have tried everything in the book. Anything involving powershellgallery will not work.
Hi @WarmWelcome, we can start debugging this by seeing if it's a network issue. Does invoke-webrequest "https://www.powershellgallery.com/api/v2"
return a status code of 200?
If you do get a 200, please try the fix suggested in this blog post.
It gives the error "The underlying connection was closed An unexpected error occurred on a send.
At line1 char1"
I'm running into the same issue.
@WarmWelcome given that you are not able to run Invoke-WebRequest
successfully, this indicates it may be a network issue instead of connectivity issue. Are you able to access https://www.powershellgallery.com/
via the web browser? There may be a firewall blocking you so just wanted to see if you are able to access the site somehow, even through the browser.
I can access https://www.powershellgallery.com/ via the browser
I get this error using invoke-webrequest
and this when trying to install a module
Will confirm this machine is in FIPS mode (but I feel I've had this work before in FIPS mode)
So I installed PS 7 on this system and tried the following:
invoke-webrequest "https://www.powershellgallery.com/api/v2" -sslprotocol tls12
I now get:
Hi Team,
Currently, getting the below error while running the command 'Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted'.
Get-PSGalleryApiAvailability : PowerShell Gallery is currently unavailable. Please try again later. At C:\Program Files (x86)\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:4264 char:9
Appreciate if someone can give me insights on this issue if it is global.