diff --git a/GitHubCore.ps1 b/GitHubCore.ps1 index a324a5bb..865cdc3d 100644 --- a/GitHubCore.ps1 +++ b/GitHubCore.ps1 @@ -223,8 +223,12 @@ function Invoke-GHRestMethod } } + # Disable Progress Bar in function scope during Invoke-WebRequest + $ProgressPreference = 'SilentlyContinue' + [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12 $result = Invoke-WebRequest @params + if ($Method -eq 'Delete') { Write-Log -Message "Successfully removed." -Level Verbose @@ -265,6 +269,9 @@ function Invoke-GHRestMethod try { + # Disable Progress Bar in function scope during Invoke-WebRequest + $ProgressPreference = 'SilentlyContinue' + [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12 Invoke-WebRequest @params } diff --git a/Telemetry.ps1 b/Telemetry.ps1 index 02296ae2..16efb7c5 100644 --- a/Telemetry.ps1 +++ b/Telemetry.ps1 @@ -181,6 +181,9 @@ function Invoke-SendTelemetryEvent $params.Add("TimeoutSec", (Get-GitHubConfiguration -Name WebRequestTimeoutSec)) $params.Add("Body", $bodyAsBytes) + # Disable Progress Bar in function scope during Invoke-WebRequest + $ProgressPreference = 'SilentlyContinue' + $result = Invoke-WebRequest @params } } @@ -211,6 +214,9 @@ function Invoke-SendTelemetryEvent try { + # Disable Progress Bar in function scope during Invoke-WebRequest + $ProgressPreference = 'SilentlyContinue' + Invoke-WebRequest @params } catch [System.Net.WebException]