Created
February 26, 2018 00:15
-
-
Save richardszalay/7f67de601411d127004230503100d1cf to your computer and use it in GitHub Desktop.
Update Sitecore NuGet packages
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
# Updates from a specific version to avoid conflicting names ("Sitecore.Framework", "Sitecore.Ship", etc) | |
$SourceVersion = "9.0.171002" | |
# Does late filtering to avoid redundant upgrades for packages that have already been upgrades as dependencies. Big time saver | |
Get-Package | ` | |
Where-Object { $_.Id -like "Sitecore.*" } | ` | |
Foreach-Object { | |
$id = $_.Id | |
if ((Get-Package -ProjectName $_.ProjectName) | ?{ $_.Id -eq $id -and $_.Version -eq $SourceVersion}) { | |
Update-Package -Id $_.Id -ProjectName $_.ProjectName -Version HighestPatch # Use HighestMinor for a full point release | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment