Trying to take a csv file and import it into an existing SharePoint list. I started with this sample and have made some modifications for our specific case.
The example uses New-PnPBatch
and Invoke-PnPBatch
to batch the Add-PnPListItem
cmdlets and should save on REST calls and increase the speed of our script. But when run the script with the batch feature I get errors on all of our date fields like this:
There was an exception while writing field reviewdate. Verify you're using the correct InternalName value for the field you want to write to.
There are three date fields in the list and I've checked the internal names and they are all correct. Additionally if I remove the -Batch switch (or comment it out like this)
Add-PnPListItem -List $ListName -Values $values #-Batch $batch
Then the items are added successfully to the list. Edit Also if I remove the date columns from the csv I can use the batch feature just fine. So I'm pretty sure it has something specific to do with date columns.
I see from this documentation that Add-PnPListItem
is supported for batching and no mention of issue with date columns are included.
Anybody else know what is going on and why I can't use -Batch
when adding list items that have dates?