Wednesday 10 July 2024

Sitecore Audit :: Avoid duplicate field names : Catch with PS script

This is a quick blog post where I want to share a useful script that you would need when working on a Sitecore Audit, if you have been working with Sitecore for a while, you mush have seen or worked on Sitecore Audits for existing website, one of the items that you audit is to confirm and make sure that the implementation avoid the existing of duplicate fields, in this post I will share a Sitecore PowerShell extensions script that you can use to find such incidents, interested, keep reading! 



Below you can find a PowerShell script that will help you find the templates that has duplicate fields, the idea is to check standard values item for each template and group by the custom fields and check if there has been any duplicates.


All what you need to do in the below script, is to update the path of the folder that contains the templates you need to verify, the code will get all templates under that folder recursively, and then check to see if there are any duplicate fields, it will print these fields in addition to the path of the template: 

 


Hopefully the above helps you on your Audit, and make it easier and faster to verify this point, happy auditing!  

No comments:

Post a Comment