I was working on Azure automation for one of our clients and on installing Az module from PowerShell gallery below error was received.
Server on which I was trying to install this module was Windows Server 2016.
On researching on internet, I found this is because connection should be on tls1.2
Enter below command in powershell shell as administrator and this issue will be fixed.
You will now be able to install the module.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
I just want to share this tip for the users that follow my blog, although you will find this when searching the Internet as many people have already faced this issue.
Thanks for reading….
Tech Wizard
Pingback: CSOM Error – Exception calling “ExecuteQuery” with “0” argument(s): The underlying connection was closed | Tech Wizard