win_chocolatey: Perform exact presence check (#23098)

The current implementation matches libreoffice-oldstable when testing for libreoffice.
So uninstalling libreoffice fails when libreoffice-oldstable is installed.

```
PS C:\WINDOWS\system32> choco list --local-only libreoffice
Chocolatey v0.10.3
libreoffice-oldstable 5.2.6
1 packages installed.
PS C:\WINDOWS\system32> choco list --local-only --exact libreoffice
Chocolatey v0.10.3
0 packages installed.
```

The solution is easy, just add `--exact`.
pull/22217/merge
Dag Wieers 8 years ago committed by Matt Davis
parent 6bad4e57bd
commit 0715430829

@ -100,7 +100,7 @@ Function Choco-IsInstalled
[string]$package
)
$cmd = "$executable list --local-only $package"
$cmd = "$executable list --local-only --exact $package"
$output = invoke-expression $cmd
$result.rc = $LastExitCode
@ -249,7 +249,7 @@ Function Choco-Install
if (Choco-IsInstalled $package)
{
if ($upgrade)
if ($state -eq "latest")
{
Choco-Upgrade -package $package -version $version -source $source -force $force `
-installargs $installargs -packageparams $packageparams `

Loading…
Cancel
Save