WARNING: Unable to find module repositories

With the deprecation of TLS 1.0 and 1.1 for PowerShell Gallery as of April 2020, the cmdlets Update-Module and Install-Module became broken. Thus, according to this article, some commands need to be executed to bring them alive again:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 
Install-Module PowerShellGet -RequiredVersion 2.2.4 -SkipPublisherCheck

If that still doesn’t work, then run the following commands:

[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
Register-PSRepository -Default -Verbose
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted

TLS 1.0 and 1.1 were also recently deprecated at NuGet.org:
nuget.org deprecated TLS 1.0 and 1.1
But that was also previously announced.

Leave a Comment

error code: 521