Insert 1 Millon Items in SP List using PowerShell
// Site URL
$siteurl = "Your Site URL"
// Assign Value
$mysite=new-object Microsoft.SharePoint.SPSite($siteurl)
$mysite=new-object Microsoft.SharePoint.SPSite($siteurl)
$spWeb = $mysite.OpenWeb()
$spList = $spWeb.Lists[“TestList”]
$spList = $spWeb.Lists[“TestList”]
// Insert 1 million items
$i = 1001
$i = 1001
do { Write-Host “Item – “$i
$spitem = $spList.Items.Add()
$spitem[“Title”] = $i.tostring()
$spitem.Update()
$i++
}
while ($i -le 1000000)
$spitem = $spList.Items.Add()
$spitem[“Title”] = $i.tostring()
$spitem.Update()
$i++
}
while ($i -le 1000000)
Comments
Post a Comment