Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install-Package should only find exact matches #169

Closed
JohnLudlow opened this issue Mar 4, 2016 · 4 comments
Closed

Install-Package should only find exact matches #169

JohnLudlow opened this issue Mar 4, 2016 · 4 comments

Comments

@JohnLudlow
Copy link

I tried to install VirtualBox, but got this error:

PS C:\WINDOWS\system32> install-package virtualbox
WARNING: 'virtualbox' matched package 'virtualbox/5.0.14.105127' from provider: 'Chocolatey', source 'chocolatey'
WARNING: 'virtualbox' matched package 'VirtualBox.ExtensionPack/5.0.14.105127' from provider: 'Chocolatey', source
'chocolatey'
install-package : Unable to install, multiple packages matched 'virtualbox'. Please specify an exact -Name and
-RequiredVersion.
At line:1 char:1
+ install-package virtualbox
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], E
   xception
    + FullyQualifiedErrorId : DisambiguateForInstall,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage


PS C:\WINDOWS\system32>

Clearly, I want to install VirtualBox. I got around this by using Find-Package and piping into Install-Package, but this shouldn't really be necessary. I noticed similar issues with npm and 7zip.

Here's what I suggest:
If Install-Package is able to find an exact match, install that since it's probably what I wanted. Install-Package -Name PackageName should just work.

If partial matches are desired, then a switch to turn them on/off from the default would work, or a wildcard syntax using asterisks.

@quoctruong
Copy link

Hi John, I think this problem exists because the chocolatey provider returns 2 instead of 1 results back to OneGet. You should contact the chocolatey team here https://github.com/chocolatey/chocolatey-oneget

@JohnLudlow
Copy link
Author

Thanks, @quoctruong. I've added an issue there now as well.

Would you like me to close this issue now or would you like to wait for a response from the chocolatey-oneget project?

Thanks again.

@JohnLudlow
Copy link
Author

@quoctruong, It seems like the https://github.com/chocolatey/chocolatey-oneget project has accepted the issue, and is willing to keep it open while it is fixed.

@quoctruong
Copy link

Thanks John. I'll close this issue then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants