Here is a list of Sitecore PowerShell scripts that are useful for every Sitecore developer for making any bulk changes in Sitecore.
As the size of the Sitecore instance increases the maintenance of the Sites would become challenging and it brings the need for a scripting tool to make bulk actions on Sitecore items. Here is a list of such scripts which would do bulk activities like checking fallback, remove/updating workflows, organising the media items etc. Il try my best to add more to this list.
1. Sitecore PowerShell script to enable Language fallback
There may be a situation where you would like to make sure the language fallback is enabled on all your Sitecore items or a particular sub tree. Checking all the items manually is not a feasible task. In such cases this script can help to check if the language fallback is enabled and if required this script can enable the fallback setting and publish the item automatically in minutes/hours based on your instance size.
Script: Sitecore PowerShell script to enable Language fallback
2. Sitecore PowerShell script to remove all language versions except one
For some reason you might want to remove all the language version except English or any other language. This would be tedious task to remove all language version even for one item as it requires to switching the language one by one and removing the versions. If there are multiple items, then it would be more challenging. So here is a script which can remove all the versions except one (either 'EN' or can be configured) for an item and its children recursively.
Script: Sitecore PowerShell script to remove all language versions except one
3. Sitecore PowerShell script to remove/update workflows
You might want to check if the right workflow is assigned to all of your items or you may have created a new workflow and like to assign this to all of your items in Sitecore or you simply want to remove the workflow of all your items. In any of these cases, you should be updating the workflow fields of each and every item in Sitecore. This is where this script can be used. This script can update the workflow field and workflow state field with a specific condition for all items or update only when there is a specific value conditionally.
Script: Sitecore PowerShell script to remove/update workflows
4. Sitecore PowerShell script to get unreferenced media items
As your Sitecore instance gets older there could be more and more media items get added to the Sitecore media library. In the long term this impacts the size of Sitecore databases. Also, it could have a performance impact. It is always required to do some basic maintenance like removing/deleting the media items that are not used since a long time. This script gets the list of all unused/unreferenced media items from the media library.
Script: Sitecore PowerShell script to get unreferenced media items
5. Sitecore powershell script to move media items based on references
This powershell script would be really interesting. Say there are multiple websites in your Sitecore. All the media items for these Sites are unorganised and your content authors may place the images in one common folder, then it would be difficult to understand which images are being used in which website. So to solve this, we can take each image and check their references, based on the references it can be understood which site node is using this image. Now we can create a new folder inside the media library for this particular site and place this image in that folder. Like this we can check each of the media items inside the media library and move to the appropriate folder. If a media item is being used in multiple site nodes, then we can place this in a common folder. All these cannot be done manually and hence this script would be really helpful.
Script: Sitecore powershell script to move media items based on references
6. Sitecore Powershell script to change template of items
There may be a chance that some items could exist whose template may not be available, this only arises when we move the items to a difference Sitecore instance without including its template. In such cases, when we click on the item we would see a dialog with an error. It is not possible to correct it manually. The only option is to change the template of the item to an available template programatically. This script does the same. It changes the template id of the items to a selected template id.
Script: Sitecore Powershell script to change template of items
7. Sitecore Powershell script to remove renderings of items
If you want to reset or remove the rendering of multiple items doing it manually would be a tedious task. As we have to remove each rendering one by one from the item presentation details. Doing this with a Sitecore Powershell script is the quickest solution.
Script: Sitecore Powershell script to remove renderings of items
I try my best to keep this list updated. Hope you find these scripts helpful. Please comment your thoughts.