From 1d33d6ed32cc38e72802f40051eedb54261c9324 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Mon, 25 Nov 2024 11:35:19 +0100 Subject: [PATCH] optimize download without progressbar --- util/winget.psm1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/winget.psm1 b/util/winget.psm1 index b5a8c84..633d521 100644 --- a/util/winget.psm1 +++ b/util/winget.psm1 @@ -1,5 +1,6 @@ function InstallWinget { + $progressPreference = 'silentlyContinue' $download = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest' $setup = "$env:TMP\winget_setup.msixbundle" @@ -9,9 +10,12 @@ function InstallWinget $assets = $releases | Select-Object -ExpandProperty "assets" $installer = $assets | Where-Object "name" -Match "msixbundle" $url = $installer | Select-Object -ExpandProperty "browser_download_url" - Invoke-RestMethod $url -OutFile $setup + + Write-Host "Downloading WinGet '.msixbundle' installer ..." + Invoke-WebRequest $url -OutFile $setup } + Write-Host "Installing WinGet app package ..." Add-AppxPackage -Path $setup }