jdhitsolutions/PSReleaseTools

Invoke-Restmethod required TLS 1.2

jbirley opened this issue · 2 comments

PSVersion Table

PSVersion 5.1.16299.248
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.248
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

What is the syntax or expression you are using?

Get-PSReleaseSummary

What happens?

Invoke-Restmethod : The request was aborted: Could not create SSL/TLS secure channel.
At C:\Users\Jim\Documents\WindowsPowerShell\Modules\PSReleaseTools\0.6.0\PSReleaseTools.psm1:81 char:17

  •     $data = Invoke-Restmethod -uri $uri -Method Get
    
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    • FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

What do you think should happen?

After a quick google search I executed this in my PowerShell session:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
I then ran 'Get-PSReleaseSummary' again and it worked perfectly.

Need to add [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 to my module.

fixed with commit 8a58d90 and release 0.6.1