Import Data from excel to SharePoint List using PowerShell

Advertisement
In this article we are able to show how to import CSV excel data in to SharePoint List, some time we have to Import large amount of information from excel CSV to SharePoint list for this we can use PowerShell script, we created a list with name "ImportCSVData" with three fields Year,MovieName,HeroName.
 How to add fields to list in sharepoint using powershell 
Copy value from one filed to another field using PowerShell - See more at: http://www.dotnetsharepoint.com/2015/07/copy-value-from-one-filed-to-another.html#sthash.QPHZ7Tjz.dpuf
Copy value from one filed to another field using PowerShell 
Date formula in SharePoint calculated value
 Date formula in SharePoint calculated value 

Excel will looks like this

$info = Import-CSV ‘D:\ImportData.csv' -header("Year", "MovieName","HeroName")
$web = Get-SPWeb -Identity "http://dotnetsharepoint.com/sites/sharepoint2013/importdata"
$list= $web.Lists["ImportCSVData"]
foreach ($rows in $info )
{
    $item = $list.Items.Add();
    $item["Year"] = $rows.Year
    $item["MovieName"] = $rows.MovieName
    $item["HeroName"] = $rows.HeroName
    $item.Update()
}
Write-Host "Excel information Updated successfully in to List"
$web.Dispose()

How to update the modified by using power shell
How to create topic for discussion board in sharepoint using powershell

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM
Advertisements
SHARE

Lakshmi Tulasi Jasti

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

1 comments:

  1. How to add the version History to the List Items with PowerShell?
    Is it possible?

    ReplyDelete