Error: “Install-Package : Unable to find repository. Use Get-PSRepository to see all available repositories”

Scenario: We just discovered that our Exchange Online Mangement tools were no longer connecting. When we would run connect-exchangeonline we would receive an error message stating something similar to: ResourceUnavailable: (:) [New-ExoPSSession]

After investigation, we saw that the ExchangeOnlineManagment module was an older module, so we decided to try to update the module. When we ran this command Update-Module ExchangeOnlineManagment we ran into this Error:

PackageManagement\Install-Package : Unable to find repository ‘https://www.powershellgallery.com/api/v2’. Use Get-PSRepository to see all available repositories.

Solution: In order to fix this, I had to register and trust the PSGallery repository, and then I was successful with funning this module:

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

Register-PSRepository -Default -Verbose

Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted

Update-Module ExchangeOnlineManagement



Leave a comment