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?
1 Answer
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