I'm trying to push multiple nuget packages at ONCE to private VSTS nuget server.
I searched doco but could not find a batch Push command. I'm using the command below which seems to overwrite already existing nuget packages on VSTS.
nuget push mynuget.nupkg -Source https://myvsts.pkgs.visualstudio.com/DefaultCollection/_packaging/SitecorePackages/nuget/v3/index.json -ApiKey VSTS
UPDATE:
I used the push *.nupkg however, I can see only the 8.1.x version pushed.
Thanks.
It's not possible to overwrite existing packages on VSTS. nuget.exe allows wildcards for push, so you could say nuget push *.nupkg -Source https://myvsts.pkgs.visualstudio.com/DefaultCollection/_packaging/SitecorePackages/nuget/v3/index.json -ApiKey VSTS
.
First, I exclude previously uploaded packages from the "packages" folder and it contains only packages that not exists in local server. After that I use below command and it works fine.
nuget.exe push -Source "MyFeedName" -ApiKey VSTS packages\**\*.nupkg
Here is a powershell script you can use to bulk push NuGet packages to a VSTS feed. It will ignore any of the .symbols.nuget files:
set-location \\path\to\nugetpackages
$files=get-childitem | where {$_.Name -like "*.nupkg" -and $_.Name -notlike "*symbols*"}
foreach($file in $files) {
.\NuGet.exe push -Source "MySource" -ApiKey key $file.name
}
来源:https://stackoverflow.com/questions/37185121/push-multiple-packages-to-private-nuget-vsts-with-one-command