Skip to content

Enhancement: add 'content' option to 'spo listitem batch add' #4666

@martinlingstuyl

Description

@martinlingstuyl

In the spo listitem batch add command we have the opportunity to load the CSV content from a filePath.

I'd like us to extend this to be able to load the csv content directly from a string.
This is useful, for example, in PowerShell scripts when building up a set of items to post and using the ConvertTo-CSV commandlet to get a csv string from that.

The idea is that you can work within memory and don't need to save a file to disk if you don't want to. I mean: why save to disk first if you don't have to. Especially with CSV, which is just string content anyway. When running (for example) in an Azure Function, saving to disk is an extra thing you have to think about: what name are you going to use, is that unique, and do you need to clean up afterwards. All these things can be ignored when just working from memory.

Option Description
-p, --filePath [filePath] The absolute or relative path to a flat file containing the list items. Specify filePath or csvContent, but not both.
-c, --csvContent [csvContent] A string content in CSV-format containing the list items. Specify filePath or csvContent, but not both.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions