Created
July 20, 2018 23:33
-
-
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...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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