Created
October 17, 2012 13:39
-
-
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."
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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