Last Updated: June 28, 2016
·
707
· vbfox

Update all Nuget packages in a solution matched by name

Here is a better version of the code already present on Coderwall and on the official bug tracker.

The complexity of the original one is too big as it tries to update all packages found for all projects, instead of just the packages present on each project.

This one is a lot quicker to update everything in a big solution :

ForEach($project in get-project -all) { ForEach($package in Get-Package -ProjectName $project.ProjectName | ?{ $_.Id -like 'MyCompany*'}) { Update-Package -ProjectName $project.ProjectName -Id $package.Id;} }

Source: https://coderwall.com/p/wtobfg <br>
Source: https://nuget.codeplex.com/workitem/3621