0

I recently tried using New-ItemClone command on SPE and encountered this error:

System.AggregateException,Cognifide.PowerShell.Commandlets.Data.Clones.NewItemCloneCommand

These are the codes used:

$master = Get-Item .
$destination = Get-Item -Path "master:\content"   
$siteName = "myNewSite"

$newSite = New-ItemClone $master -Destination $destination -Name $siteName -Recurse

enter image description here

I'm using Sitecore 8 update 2 and SPE 4.7.2

Any clue what this might be? I'm new to using Sitecore cloning. Is there a particular item that can't be cloned? I've searched for documentations but can't find a specific one for this error.

  • 1
    Could you check your Sitecore logs and search for errors? (there is an error in some item:saving handler) – Alan Płócieniak Jul 6 '18 at 13:57
  • 1
    Do you have custom events in the item:saving? – Hishaam Namooya Jul 6 '18 at 17:08
  • Yes, we have a custom event on the item:saving. I'll look into it more and come back to this – qwert Jul 9 '18 at 5:54
0

So looking into my solution, I found out that this error is due to a custom item:saving event code that was being called when executing New-ItemClone command. Putting a condition when this New-ItemClone is executing fixes the problem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.