Hi,
when I use powershell 5.1 to install the azureAD module I get the following error
[pre]
[pre]
Paul
Hi,
when I use powershell 5.1 to install the azureAD module I get the following error
[pre]
[pre]
Paul
Try this, run this in 5.1 and then try to install the module.
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
Doug you rock thanks for this
can you explain to me what this does exactly
Best regards
Paul
They dropped support for TLS 1.0, so you instructed powershell to use 1.2. See this thread.
Glad I could help.
another question
I’m preparing a script that is going to be shared with a couple of users.
and they need to have to install the required modules as well.
is there a way to test what the current security protocol state is?
this way I can integrate this in my checks that if current security protocol is not equal to
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
to run this?
It’s only an issue in 5.1. What’s the harm in adding this to the beginning of each of your scripts just in case? Even if it’s set, it won’t error. However, you could potentially check it like this, but surely there is a better way.
if([Net.ServicePointManager]::SecurityProtocol -notmatch 'tls12') { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 }
Or
if(([Net.ServicePointManager]::SecurityProtocol -split ',').trim() -notcontains 'tls12') { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 }
thanks Doug,
the goal is to create a check.ps where all these things are checked and once a module is installed I don’t require to change the current settings
Paul