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

前端 未结 3 1391
孤城傲影
孤城傲影 2021-01-31 07:13

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

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-31 07:45

    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 
    

提交回复
热议问题