Download all packages from private nuget feed

徘徊边缘 提交于 2020-01-03 22:55:58

问题


I want to download all packages in all version from my private nuget feed. Thats it. I have no problem in using powershell, bash, package manager what ever.

I can't use a placeholder project - that references all packages and copy my cache, because I need all versions.

Any idea?

I am working with a private nuget-feed. The feed is kind of broken, but its not in my hand to fix it. So I have to go this way...


回答1:


With PowerShell you can do this:

>Find-Package -Name='Package_Name'  -AllVersions -Source Local | Install-Package -Destination 'C:\SOME_PATH'

The command will find all the versions of packages with name like 'Package_Name' in the source Local (has to be specified in NuGet.config), and install them to 'C:\SOME_PATH' folder. To get all the packages from the source remove the -Name parameter.

Then you can get each .nupkg file from its own folder.




回答2:


I created a better PowerShell here that download all packages for all versions

Find-Package -AllVersions -Source NuGet-Source | ForEach-Object {
   Install-Package -Name $_.Name -MaximumVersion $_.Version -Destination 'C:\Temp\Nuget\' -Source NuGet-Source -SkipDependencies
}


来源:https://stackoverflow.com/questions/51357378/download-all-packages-from-private-nuget-feed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!