mirror of
https://github.com/Baipyrus/dotfiles.git
synced 2024-12-26 03:11:45 +00:00
optimize download without progressbar
This commit is contained in:
parent
4ce997d016
commit
1d33d6ed32
@ -1,5 +1,6 @@
|
|||||||
function InstallWinget
|
function InstallWinget
|
||||||
{
|
{
|
||||||
|
$progressPreference = 'silentlyContinue'
|
||||||
$download = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
|
$download = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
|
||||||
$setup = "$env:TMP\winget_setup.msixbundle"
|
$setup = "$env:TMP\winget_setup.msixbundle"
|
||||||
|
|
||||||
@ -9,9 +10,12 @@ function InstallWinget
|
|||||||
$assets = $releases | Select-Object -ExpandProperty "assets"
|
$assets = $releases | Select-Object -ExpandProperty "assets"
|
||||||
$installer = $assets | Where-Object "name" -Match "msixbundle"
|
$installer = $assets | Where-Object "name" -Match "msixbundle"
|
||||||
$url = $installer | Select-Object -ExpandProperty "browser_download_url"
|
$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
|
Add-AppxPackage -Path $setup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user