PowerShell: Upload a CSV file to a SharePoint List

11 Sep 2017
September 11, 2017

Wow, it’s been a while since I last blogged – and here comes a tiny helper to upload one or more CSV file to a SharePoint Online list.
I think its the best documented script I ever created…!!!

The script

The following script checks a folder for files – and opens them. Then each line will be uploaded to the specified SharePoint list defined by the provided mapping.
The mapping is kinda straight forward. The header (if present, skip it with -skipFirstRow flag) is not required, you have to provide it via the -mapping parameter.

If you have the following in your CSV:
Value 1; Value 2

and want those values in a list with Column1 and Column2, then provide the script -mapping Column1, Column2.

Please note: The types are currently not passed and I only tested it with text values – if that is something you need, it could be easily added.

And the rest of the parameters? They are of course documented in the script. Copy it to a file and do get-help -full <yourfile.ps1> to get it!

 Feedback

So is it working for you? If so, please leave a comment!

Max Melcher
Follow me!

Max Melcher

Maximilian Melcher (MCSE, MCPD) is a Principal Consultant working at Alegri International Services in Munich, Germany. Max is a specialist in SharePoint technologies focused on search, social computing, web content management and collaboration. Max has led SharePoint implementations for Dax 30 companies since 2009.
Max’s free time is spent on twitter (@maxmelcher) mostly with a good coffee in his hands.
Max Melcher
Follow me!
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close