Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all available versions of a specific package in NuGet Package Manager Console

What NuGet PowerShell command will return a list of all versions of a specific package?

I have tried the following, but it only returns one version of NUnit along with a number of other (un)related packages, each having only one version.

Get-Package -Source https://go.microsoft.com/fwlink/?LinkID=206669 -ListAvailable -Filter NUnit -AllVersions 

Note: I specify the source URI because we have our own internal package source as our default remote.

My understanding is that the -AllVersions switch should pull back every version of each matching package.

I can't seem to figure out:

  1. Am I doing it wrong?
  2. If not, are project maintainers (or someone else) removing older versions from the package source?
  3. If they are, why?
like image 347
Aaron Torgerson Avatar asked Aug 08 '12 15:08

Aaron Torgerson


People also ask

How do I get NuGet package list?

go to the Project or Solution in question. right click, Manage NuGet Packages... on the left, you will see 'Installed Packages' click on this and you will see the list.

How do I find the NuGet package version?

In Visual Studio, use the Help > About Microsoft Visual Studio command and look at the version displayed next to NuGet Package Manager. Alternatively, launch the Package Manager Console (Tools > NuGet Package Manager > Package Manager Console) and enter $host to see information about NuGet including the version.

What command can you use to search for a package in the NuGet Package Manager console?

Find and install a package Open the project/solution in Visual Studio, and open the console using the Tools > NuGet Package Manager > Package Manager Console command. Find the package you want to install.


1 Answers

Your source resolves to the version 1 of the feed which doesn't seem to work with -AllVersions (I filed an issue: https://github.com/NuGet/NuGetGallery/issues/563)

Using the V2 feed works for me:

get-package -ListAvailable -AllVersions -filter nunit -source https://nuget.org/api/v2/ 

But note that -filter is not for a specific package, but more like a search term.

As a workaround, I'd use tab autocomplete to get the versions list of a specific package:

install-package -source https://nuget.org/api/v2/ -id nunit -version <tab> 
like image 105
Alexandre Dion Avatar answered Sep 21 '22 23:09

Alexandre Dion