Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions GitHubCore.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ function Invoke-GHRestMethod
}

$NoStatus = Resolve-ParameterWithDefaultConfigurationValue -Name NoStatus -ConfigValueName DefaultNoStatus
$securityProtocol = [Net.ServicePointManager]::SecurityProtocol
Comment thread
giuseppecampanelli marked this conversation as resolved.
Outdated

try
{
Expand Down Expand Up @@ -267,6 +268,8 @@ function Invoke-GHRestMethod
}
}

$securityProtocol = [Net.ServicePointManager]::SecurityProtocol

try
{
# Disable Progress Bar in function scope during Invoke-WebRequest
Expand Down Expand Up @@ -300,6 +303,10 @@ function Invoke-GHRestMethod
$jsonConversionDepth = 20 # Seems like it should be more than sufficient
throw (ConvertTo-Json -InputObject $ex -Depth $jsonConversionDepth)
}
finally
{
[Net.ServicePointManager]::SecurityProtocol = $securityProtocol
}
}

$null = Start-Job -Name $jobName -ScriptBlock $scriptBlock -Arg @(
Expand Down Expand Up @@ -540,6 +547,13 @@ function Invoke-GHRestMethod
Set-TelemetryException -Exception $ex -ErrorBucket $errorBucket -Properties $localTelemetryProperties -NoStatus:$NoStatus
throw $newLineOutput
}
finally
{
if ($NoStatus)
Comment thread
giuseppecampanelli marked this conversation as resolved.
Outdated
{
[Net.ServicePointManager]::SecurityProtocol = $securityProtocol
}
}
}

function Invoke-GHRestMethodMultipleResult
Expand Down