Skip to content

Instantly share code, notes, and snippets.

@MrAntix
Created October 17, 2012 13:39
Show Gist options
  • Save MrAntix/3905576 to your computer and use it in GitHub Desktop.
Save MrAntix/3905576 to your computer and use it in GitHub Desktop.
Update all Nuget Packages in a solution given the Id starts with "Antix."
# Put in the solution root and call with .\Update-Antix.ps1
$startingWith = "Antix."
$projects = Get-Project -All
$packagesFound = @()
foreach($project in $projects)
{
$path = Join-Path (Split-Path $project.FileName) packages.config
if(Test-Path $path)
{
$xml = [xml]$packages = Get-Content $path
foreach($package in $packages.packages.package)
{
$id = $package.id
if($id.StartsWith($startingWith)
-and $packagesFound -notcontains $id){
$packagesFound+=$id
}
}
}
}
foreach($packageFound in $packagesFound){
# write-host $packageFound
update-package $packageFound
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment