Skip to content

Instantly share code, notes, and snippets.

@AdamNaj
Created June 5, 2017 14:38
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 AdamNaj/a21ec421ce628ee4caf71be2fe3aae19 to your computer and use it in GitHub Desktop.
Save AdamNaj/a21ec421ce628ee4caf71be2fe3aae19 to your computer and use it in GitHub Desktop.
Unicorn vs Sitecore Serialization compare
$sitecoreSerializationPath = "C:\inetpub\wwwroot\sitecore81\Data\serialization"
$unicornSerializationPath = "C:\Projects\sitecorepowershell\Trunk\Cognifide.PowerShell\serialization"
$serializationIds = gci $sitecoreSerializationPath -filter "*.item" -recurse | Get-Content -first 3 | ? { $_.Startswith("id:") } | % { $_.Substring(5,36).ToLower() }
$unicornIds = gci $unicornSerializationPath -filter "*.yml" -recurse | Get-Content -first 2 | ? { $_.Startswith("ID:") } | % { $_.Substring(5,36) }
"$($serializationIds.Count) items in Sitecore Serialization"
"$($unicornIds.Count) items in Unicorn Serialization"
Write-Host "---- Missing in Unicorn ----"
$serializationIds | ? { $unicornIds.IndexOf($_) -lt 0 }
Write-Host "---- Missing in Sitecore Serialization ----"
$unicornIds | ? { $serializationIds.IndexOf($_) -lt 0 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment