Archive for month: September, 2017

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!

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