Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@realslacker
Created July 20, 2018 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save realslacker/233ff82f71685cbf191feea23c43f046 to your computer and use it in GitHub Desktop.
Save realslacker/233ff82f71685cbf191feea23c43f046 to your computer and use it in GitHub Desktop.
One liner to bump up TLS available for Invoke-WebRequest, Invoke-RestMethod, etc...
# Bump up the TLS profile to the max value supported by your system
[System.Enum]::GetValues('Net.SecurityProtocolType') |
Where-Object { $_ -gt [System.Math]::Max( [Net.ServicePointManager]::SecurityProtocol.value__, [Net.SecurityProtocolType]::Tls.value__ ) } |
ForEach-Object {
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor $_
}
# The rest of your Profile.ps1 ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment