Friday 25 April 2014

SharePoint Add Test Data to List

SharePoint Add Test Data to List
If you want to add more data to list, you can use poershell.
Open Poweshell in administration mode.
Type below commands...

cls
Remove-PSSnapin Microsoft.SharePoint.Powershell
Add-PSSnapin Microsoft.SharePoint.Powershell
$webUrl = “http://SP2010";
$web = Get-SPWeb $webUrl;
$list = $web.Lists.TryGetList("MyListName");
(1..100)|%{
$ID=$item.ID;
$x=1;
$A=$ID+$x;
$item = $list.Items.Add();
$item["Title"]="Test";
$item["A"]=$A;
$item.Update();
$item.ID
}
$web.Dispose()