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:
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.
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.
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.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With