From 098c3e51e1f43a5982ad0a8a575f5fc3bb80d285 Mon Sep 17 00:00:00 2001 From: Luke Markie Date: Tue, 6 Feb 2024 13:59:57 +0000 Subject: [PATCH] Add option to disable download progress bar on Windows which may increase speeds --- readme.md | 2 ++ windows/observability-agent-autoconf.ps1 | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/readme.md b/readme.md index 0ec466a..39763b3 100644 --- a/readme.md +++ b/readme.md @@ -61,6 +61,8 @@ You can use both `--install` and `--config.file` options in the same run command or
`sudo path/to/observability-agent-autoconf.sh --config.file path/to/config --install false` +For Windows, you can add `--disable-dl-progress-bar true` to potentially speed up downloads. + ## Docker When running in Docker, you will not be prompted for any information. Therefore, you must specify an api key before running. Additionally, you must set the relevant environment variables for whichever services you have running, so they can be configured. These environment variables can be found in the [Environment Variables](#environment-variables) section. diff --git a/windows/observability-agent-autoconf.ps1 b/windows/observability-agent-autoconf.ps1 index e3d2470..16b3089 100644 --- a/windows/observability-agent-autoconf.ps1 +++ b/windows/observability-agent-autoconf.ps1 @@ -24,6 +24,14 @@ while ($args) { $args = $args[2..$args.Count] break } + "--disable-dl-progress-bar" { + if ($args[1] -eq "true") + { + $DisableDownloadProgressBar = $true + } + $args = $args[2..$args.Count] + break + } default { Write-Error "Invalid option: $($args[0])" exit 1 @@ -43,6 +51,10 @@ if ($INSTALL -ne $false) { $installPath = "$PSScriptRoot/grafana-agent-flow-installer.exe" # Download the file + if ($DisableDownloadProgressBar -eq $true) + { + $ProgressPreference = 'SilentlyContinue' + } Invoke-WebRequest -Uri $url -OutFile $outputPath # Extract the contents of the zip file