SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

knowing that is possible in PS, exporting SPList items to PS objects(link1 link2) what is the best way, to go into the other way: Create/Update an SPList from an exported csv or format-table.

share|improve this question

There are 3rd party tools that can automate the update process (only changed items updated, so you can add workflows or attachments).

See here for step-by-step guide:

share|improve this answer
Thanks a lot for the reply, but actually is not a complex PS script to do that. I just wanna know the best way to go. – fallout Jun 29 '12 at 7:37
up vote 1 down vote accepted

After creating manually an list based on or csv template via UI...

#get data
$csv = Import-Csv ‘C:\MyData.csv‘
#get list
$web = Get-SPWeb -identity “MyTargetListURL”

foreach ($row in $csv) {
    #Check for existing item
    $SPItem = $SPList.Items | Where { $_["ItemId"] -eq $row.ItemId } 

    If ($SPItem -ne $null) { 
        $SPItem["ColumnNumberType"] = [System.Convert]::ToInt32($row.ColumnNumberType)
        $SPItem["Column with special-chars"] = $row."Column with special-chars"
        #rest of fields

    Else { 
        $SPNewItem = $SPList.Items.Add() 
        $SPNewItem["ItemId"] = $row.ItemId 
        #rest of fields

share|improve this answer

I think fallout's answer partially answers the question. His 'if statement' checks if items exist, then updates items if they exist, otherwise it creates new items if they do not exist. Depending on your columns, the trick is to update only those items that have changed in the CSV file (required for efficient version control in the sharepoint list).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.