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.

3
  • 1
    Could you check your Sitecore logs and search for errors? (there is an error in some item:saving handler) Commented Jul 6, 2018 at 13:57
  • 1
    Do you have custom events in the item:saving? Commented Jul 6, 2018 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
    Commented Jul 9, 2018 at 5:54

1 Answer 1

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 and acknowledge you have read our privacy policy.

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