Skip to content

Instantly share code, notes, and snippets.

@DominicCronin
Created February 19, 2014 09:55
Show Gist options
  • Save DominicCronin/9089062 to your computer and use it in GitHub Desktop.
Save DominicCronin/9089062 to your computer and use it in GitHub Desktop.
execute export and import
$impexp = get-ImportExportServiceClient
$contentFolderSelection = new-object SubTreeSelection "tcm:3-1005-2",$false
$exportInstruction = new-object ExportInstruction
$exportInstruction.BluePrintMode = [BluePrintMode]::ExportSharedItemsFromOwningPublication
($processId = $impexp.StartExport( @($contentFolderSelection),$exportInstruction))
WaitForImportExportFinish $impexp $processId
DownloadPackageToFile $processId "package.zip"
$uploadId = UploadPackageFromFile "package.zip"
$impexp = get-ImportExportServiceClient
$processId = $impexp.StartImport($uploadId, (new-object ImportInstruction))
$impexp.GetProcessState($processId)
WaitForImportExportFinish $impexp $processId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment