LoGanathan

About Me
I am LoGanathan. I am a Software professional. I write here on the technologies that I like, learn and use.

Friday, 26 October 2012

Here the import the more than documents to add the lists using the Power Shell  Commands.

1.we have to add the title of the list  and body of contents and expire date.its like this

and save as .csv format.

2.After that using this code in Notepad



Add-PsSnapin Microsoft.SharePoint.Powershell –ErrorAction SilentlyContinue
$csv = Import-Csv 'csv file path'

$web = Get-SPWeb -identity "Domin Name"

$list = $web.Lists["ListName"]

foreach ($row in $csv) {
$item = $list.Items.Add();
$item["Title"] =$row.Title
$item["Body"] =$row.Body
$item["Expires"] =$row.Expires
$item.Update()
}
Write-Host "Finished! Press enter key to exit." -ForegroundColor Green
Read-Host


and save as filename.ps1 format.
3.finally exect that file

Automatically created the contents on the particular list.


Categories:

0 comments:

Post a Comment