Console icon indicating copy to clipboard operation
Console copied to clipboard

New-Item -ForceID does not work with branch templates

Open zmalmquistmerkle opened this issue 3 years ago • 1 comments

Expected Behavior

When using ForceID with branch templates I expect that the GUID is maintained

Actual Behavior

The ID I set is ignored and a random guid is set instead

Steps to Reproduce the Problem

Example - $DestinationItem = New-Item -Path $locationDataPath -Name $SourceItem.Name -ItemType "{CBD20F7D-DEBA-4CAB-8B76-E0531963E7B7}" -ForceId $SourceItem.Id

if ItemType is of branch template, this fails to use the ID I send it

Please include the version number of SPE and Sitecore.

SPE - 6.3 Sitecore - 10.2

zmalmquistmerkle avatar Jun 14 '22 23:06 zmalmquistmerkle

Does the log contain any errors? Does it create the branch and ignore the value in the ForceId parameter?

michaellwest avatar Jun 15 '22 00:06 michaellwest

This appears to be fixable - even though The API does not suggest that it should work. But when I pass the Branch ID to the API like it was a template it creates the branch with the root item having the forced ID.

AdamNaj avatar May 09 '24 22:05 AdamNaj