Open kdpuvvadi opened 1 year ago
cc @denelon, #221
tested this on both 1.5.1881 and 1.6.1573-preview
This is definitely still an issue:
~\configs\Windows on win-setup-admincoprocess
❯ winget install --source winget --id Google.Chrome --scope machine --silent
Found an existing package already installed. Trying to upgrade the installed package...
No available upgrade found.
No newer package versions are available from the configured sources.
~\configs\Windows on win-setup-admincoprocess
❯ Install-WinGetPackage -Source winget -Id Google.Chrome -Scope System -Mode Silent -Verbose
VERBOSE: Performing the operation "Install-WinGetPackage" on target "Google Chrome [Google.Chrome] Version 119.0.6045.160".
InstallerErrorCode Status RebootRequired ExtendedErrorCode CorrelationData
------------------ ------ -------------- ----------------- ---------------
0 Ok False
~\configs\Windows on win-setup-admincoprocess took 1m31s
❯ winget --version
v1.6.3133
~\configs\Windows on win-setup-admincoprocess
❯ get-module -Name Microsoft.Winget.Client
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Binary 1.6.3133.0 Microsoft.Winget.Client {Add-WinGetSource, Assert-WinGetPackageManager, Disable-WinGetSetting, Enable-WinGetSetting…}
Another, related problem is that Install-WinGetPackage
does not have a parameter for the --no-upgrade
option.
Latest PowerShell module v1.7.10661, this is still an issue.
Tested this on 1.7.10861
and issue is still present
From the source it's seems just passing all the args to the winget client but trying with same args used with ps module with winget resulting in different result.
if($Result.count -eq 1 -or $Local) {
& "WinGet" $WinGetInstallArgs
$Result = ""
}
Brief description of your issue
install-WinGetPackage
installing the package regardless installation status, update availability. I'm aware there thatUpdate-WinGetPackage
cmdlet is available but install cmdlet should also consider the installation status.Steps to reproduce
I'm using npp as base here.
check application status
Try installing with
winget
clienttry same with
install-WinGetPackage
Expected behavior
Skip install if no update available
Actual behavior
Reinstalling the package
Environment