Skip to content

Instantly share code, notes, and snippets.

@michaellwest
Last active November 6, 2018 17:19
Show Gist options
  • Save michaellwest/bf51c1cf39c5c119c710fa84ffbb73d5 to your computer and use it in GitHub Desktop.
Save michaellwest/bf51c1cf39c5c119c710fa84ffbb73d5 to your computer and use it in GitHub Desktop.
Sitecore PowerShell Extensions example transferring items between servers using rainbow serialization and spe remoting. You will want to be using SPE 5.1 or newer when transferring media items.
Import-Module -Name "SPE"
$session = New-ScriptSession -user "admin" -pass "b" -conn "https://spe-a"
$yaml = Invoke-RemoteScript -ScriptBlock {
$homeId = "{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}"
Get-ChildItem -Path "master:" -ID $homeId -WithParent -Recurse |
ConvertTo-RainbowYaml
} -Session $session
$session2 = New-ScriptSession -user "admin" -pass "b" -conn "https://spe-b"
Invoke-RemoteScript -ScriptBlock {
$using:yaml | Import-RainbowItem
} -Session $session2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment