问题
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