Insert 1 Millon Items in SP List using PowerShell

// Site URL
$siteurl = "Your Site URL"
// Assign Value
$mysite=new-object Microsoft.SharePoint.SPSite($siteurl)
$spWeb = $mysite.OpenWeb()

$spList = $spWeb.Lists[“TestList”]
// Insert 1 million items
$i = 1001
do { Write-Host “Item – “$i
         $spitem = $spList.Items.Add()
         $spitem[“Title”] = $i.tostring()
         $spitem.Update()
         $i++
}
while ($i -le 1000000)

Comments

Popular posts from this blog

IRM and the Object Model

This content database has a schema version which is not supported in this farm

Activate and Deactivate Feature through PowerShell