Console
Console copied to clipboard
New-Item -ForceID does not work with branch templates
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
Does the log contain any errors?
Does it create the branch and ignore the value in the ForceId parameter?
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.