From 7d92afb7c6f7111b13ec3cb62f8f652c7ef1660d Mon Sep 17 00:00:00 2001 From: Declan <25474733+declanjryan@users.noreply.github.com> Date: Wed, 29 Oct 2025 22:42:46 +0100 Subject: [PATCH] fix: included progress preference for fastest downloads --- install.ps1 | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/install.ps1 b/install.ps1 index dccbac9..72a1ef1 100644 --- a/install.ps1 +++ b/install.ps1 @@ -218,28 +218,38 @@ function Main { [switch]$Uninstall ) - if ($Uninstall) { - Uninstall-App - } + $oldProgressPreference = $ProgressPreference + $ProgressPreference = 'SilentlyContinue' + + try { + if ($Uninstall) { + Uninstall-App + return + } - Show-Title "Downloading PairSpaces CLI" + Show-Title "Downloading PairSpaces CLI" - $arch = Get-Arch - $version = Get-Version - $file = "$name" + "_$version.exe" - $url = "$baseUrl/windows/$arch/$file" + $arch = Get-Arch + $version = Get-Version + $file = "$name" + "_$version.exe" + $url = "$baseUrl/windows/$arch/$file" - Ensure-InstallDir + Ensure-InstallDir - $downloadPath = "$installDir\$binary" - Download-Binary -url $url -outputPath $downloadPath + $downloadPath = "$installDir\$binary" + Download-Binary -url $url -outputPath $downloadPath - Show-Title "Installing PairSpaces CLI" $url - Make-Executable $downloadPath - Ensure-InPath + Show-Title "Installing PairSpaces CLI" $url + Make-Executable $downloadPath + Ensure-InPath - Show-Title "Installation Complete" "$binary installed to $installDir" - Write-Host (" Restart your shell and run '${binary} help' to get started.") -ForegroundColor Green + Show-Title "Installation Complete" "$binary installed to $installDir" + Write-Host (" Restart your shell and run '${binary} help' to get started.") -ForegroundColor Green + } + finally { + # Always restore original preference + $ProgressPreference = $oldProgressPreference + } } if ($MyInvocation.InvocationName -ne '.') {