Skip to content

Instantly share code, notes, and snippets.

@jhorsman
Last active January 6, 2022 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jhorsman/d22d688c24d665c1e1d670abd255eec3 to your computer and use it in GitHub Desktop.
Save jhorsman/d22d688c24d665c1e1d670abd255eec3 to your computer and use it in GitHub Desktop.
Synchronize SDL Web components (by publication) with schemas using PowerShell
#WARNING this script is set to run component-sync with the -Update flag, meaning it will commit and save the changed components
#Usage examples
# .\item-sync-publications.ps1
# .\item-sync-publications.ps1 | Tee-Object sync.log
# Prerequisite: Install the tridion-powershell-modules https://github.com/pkjaer/tridion-powershell-modules
Import-Module Tridion-CoreService -Verbose:$false
Set-TridionCoreServiceSettings -Version "2013-SP1"
$publications = Get-TridionPublications | Where-Object {!$_.Title.StartsWith("_")} | Where-Object {!$_.Title.Contains("Test")}
ForEach ($pub in $publications) {
Write-Output ("Syncing publication {0} {1}" -f $pub.Id, $pub.Title)
.\item-sync.ps1 $pub.Id -Update
Write-Output ""
}
Write-Output ""
Write-Output "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment