Create a large List using Windows PowerShell in SharePoint 2010

Video length: 2:05

Video description: This video walks through the process of creating a large SharePoint 2010 list using Windows PowerShell.

Documented video steps below:

To create a large list, follow the following steps

  • Create a custom list on your site
  • Add a couple of single text item columns: Example: “Topic” and “Description”
  • Launch SharePoint 2010 Management Shell and paste the following commands:
  • Replace <SiteURL> with your site URL
  • Replace the 40 count on the last line with whatever desired item count you want.
$site = Get-SPSite <SiteURL>
$web = $site.rootweb
$list = $web.Lists[“SharePoint Quester”]
$i = 1do {
$newitem = $list.items.Add()
$newitem[“Title”] = “Client-” + $i.ToString().PadLeft(4, “0”);
$newitem[“Topic”] = “Client-” + $i.ToString().PadLeft(4, “0”);
$newitem[“Description”] = $i.ToString().PadLeft(8, “0”);
$newitem.Update()
$i++
}
while ($i -le 40)

Leave a Comment