How To Create Bulk Items in Sitecore Using Powershell Script?

Many times you need to create bulk items in Sitecore for some reason. May be you want to check the performance of your newly implemented feature. Let’s say you want to check how your code (e.g search code) is performing when there are tons of items. So once again you can take the advantage of Sitecore Powershell script here. Below is the small yet powerful Sitecore Powershell script (.ps) which will empower you to create desired number of items based on given template.

#This script will create sitecore items based on given count and template $InputCount = Show-Input "How many items do you want to create?" $InputTemplate = Show-Input "Using which template you want to create item?" $getCurrentItem = Get-Item . $NewItemPath = $getCurrentItem.FullPath $CurrentChildCount = $getCurrentItem.Children.Count+1 for ($index = $CurrentChildCount; $index -lt $CurrentChildCount+$InputCount; $index++)  {    new-item -Path $NewItemPath -Name $index -type $InputTemplate } 

You can create the script named Create Bulk Items  under /sitecore/system/Modules/PowerShell/Script Library/Package Generator/Content Editor/Context Menu/Packaging

When you run above script, it will ask you: 1) How many number of items do you want to create?

2) Using which template you want to create items?

Below screen summarizes the entire step by step process to create bulk items in Sitecore.

This script is powered by Sitecore Powershell Extensions, so please make sure that you have Powershell extensions installed in your Sitecore instance. If you want to download Sitecore Powershell Extensions, click here for the same. Empower you Sitecore Journey by using Sitecore Powershell Extensions!

10 Responses to “How To Create Bulk Items in Sitecore Using Powershell Script?”
  1. Michael West October 20, 2015
  2. Adam Najmanowicz October 20, 2015
  3. Unknown November 3, 2015
  4. Nilesh Thakkar November 3, 2015
  5. Nilesh Thakkar November 3, 2015
  6. Nilesh Thakkar November 3, 2015
  7. Unknown February 23, 2016
  8. Nilesh Thakkar February 23, 2016
  9. San May 11, 2016
  10. Anonymous August 30, 2017

Leave a Reply