1

I need to create an array of templates that refer to a particular rendering. In some templates, renderings are placed twice. So, array contains 2 copies of same templates. What is the sitecore powershell command to remove duplicate items from an array of sitecore items?

4

You can simply remove the duplicate items from the array by using Sort-Object with the -Unique switch, It will combine sorting with the removal of duplicates. Alias of Sort-Object is sort -

$YourItemArrayList | sort -unique

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.