From 0f4ae3ff4e9e55c0ac5187a15779d205536c13a2 Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Thu, 8 Aug 2019 08:25:37 +0100 Subject: [PATCH] Disable the progress bar when downloading the Dart SDK via Invoke-WebRequest (#37792) --- bin/internal/update_dart_sdk.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/internal/update_dart_sdk.ps1 b/bin/internal/update_dart_sdk.ps1 index c64be58f44..8d32febc27 100644 --- a/bin/internal/update_dart_sdk.ps1 +++ b/bin/internal/update_dart_sdk.ps1 @@ -59,7 +59,14 @@ Try { } Catch { Write-Host "Downloading the Dart SDK using the BITS service failed, retrying with WebRequest..." + # Invoke-WebRequest is very slow when the progress bar is visible - a 28 + # second download can become a 33 minute download. Disable it with + # $ProgressPreference and then restore the original value afterwards. + # https://github.com/flutter/flutter/issues/37789 + $OriginalProgressPreference = $ProgressPreference + $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri $dartSdkUrl -OutFile $dartSdkZip + $ProgressPreference = $OriginalProgressPreference } Write-Host "Unzipping Dart SDK..."