NuGet / Home

Repo for NuGet Client issues
Other
1.49k stars 250 forks source link

Find-Package (Powershell) ignore -Version parameter #3344

Open Tasteful opened 8 years ago

Tasteful commented 8 years ago

The Find-Package ignores the -Version parameter. I want to use that to see if a package exists in a specific version.

PM> Find-Package -Id Newtonsoft.Json -ExactMatch -Version 8.0.3

Id                                  Versions                                 Description                              
--                                  --------                                 -----------                              
Newtonsoft.Json                     {9.0.1}                                  Json.NET is a popular high-performance...

Environment

Package Manager Console Host Version 3.4.4.1321
Visual Studio 2015.3
Tasteful commented 8 years ago

Workaround is to use the -AllVersions and check if the returned versions contains the expected

(Find-Package -Id Newtonsoft.Json -ExactMatch -AllVersions).Versions -contains [NuGet.Versioning.SemanticVersion]"8.0.3"