Updating TLS in PowerShell to Allow Set-PSRepository to Run
I was recently working on a client server and need to install the Az PowerShell module. I opened and administrator window and typed
Install-Module Az
and received this error:
WARNING: Unable to find module repositories.
Searching the error, I was told to run
Register-PSRepository -Default
The command completed without an error, but I got the same error when trying to install the
module. Az
Some additional digging led me to check the TLS version PowerShell was running. It turned out it was using TLS 1.0. Running this command updated TLS to 1.2:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
and allowed the Register-Repository command to execute successfully.
Thanks for reading and I hope this helps.
Categories: Azure, PowerShell
Azure, PowerShell, TLS
Comments (0)
Trackbacks (0)
Leave a comment
Trackback