Skip to content

Instantly share code, notes, and snippets.

@richardszalay
Created February 26, 2018 00:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richardszalay/7f67de601411d127004230503100d1cf to your computer and use it in GitHub Desktop.
Save richardszalay/7f67de601411d127004230503100d1cf to your computer and use it in GitHub Desktop.
Update Sitecore NuGet packages
# 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