Wednesday, July 1, 2015

Sharepoint Powershell - Add bulk items to Sharepoint lists

cls

$webURL = "http://SiteURL"
$listName = "List_Name"


$web = Get-SPWeb $webURL
  
$list = $web.Lists[$listName]

#Add 1000 items to the list

for ($i=1;$i -lt 1001; $i++) {
$newItem = $list.Items.Add()

           #Add properties to this list item

           $newItem["Title"] = "Test Item"+ $i.ToString()
            $newItem.Update()

}

No comments:

Post a Comment