From 4024adcd6d1224e453b6a31f35d99cf04100595d Mon Sep 17 00:00:00 2001 From: Alan Guedes Date: Sat, 23 Nov 2024 16:11:09 +0000 Subject: [PATCH] refact winget_install --- os/win.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/os/win.ps1 b/os/win.ps1 index bb14b093..41fec41f 100644 --- a/os/win.ps1 +++ b/os/win.ps1 @@ -206,15 +206,15 @@ function win_install_nodejs_noadmin() { } } -function _winget_install() { - winget install --accept-package-agreements --accept-source-agreements --scope user -e --id $args +function _winget_install_agree_user_scope() { + winget install --accept-package-agreements --accept-source-agreements --scope user -e $args } function winget_install() { param ([Parameter(Mandatory = $true)][string] $pkg) winget list --accept-source-agreements -q $pkg | Out-Null if (-not $?) { - _winget_install $pkg + _winget_install_agree_user_scope --id $pkg } } @@ -225,7 +225,7 @@ function winget_install_at_location() { ) winget list --accept-source-agreements -q $pkg | Out-Null if (-not $?) { - _winget_install --location="$location" $pkg + _winget_install_agree_user_scope --id $pkg --location="$location" } } @@ -233,7 +233,7 @@ function winget_uninstall() { param ([Parameter(Mandatory = $true)][string] $pkg) winget list --accept-source-agreements -q $pkg | Out-Null if ($?) { - winget uninstall --silent "$pkg" + winget uninstall --id $pkg --silent } }