diff --git a/GitHubCore.ps1 b/GitHubCore.ps1 index 542ae5a8..09068429 100644 --- a/GitHubCore.ps1 +++ b/GitHubCore.ps1 @@ -201,6 +201,7 @@ function Invoke-GHRestMethod } $NoStatus = Resolve-ParameterWithDefaultConfigurationValue -Name NoStatus -ConfigValueName DefaultNoStatus + $originalSecurityProtocol = [Net.ServicePointManager]::SecurityProtocol try { @@ -560,6 +561,10 @@ function Invoke-GHRestMethod Set-TelemetryException -Exception $ex -ErrorBucket $errorBucket -Properties $localTelemetryProperties -NoStatus:$NoStatus throw $newLineOutput } + finally + { + [Net.ServicePointManager]::SecurityProtocol = $originalSecurityProtocol + } } function Invoke-GHRestMethodMultipleResult