powershell
powershell copied to clipboard
Invoke-PnPBatch: Issue submitting sequential batches
We need to update large libraries with up to 1m documents per library.
Using Set-PnPListItem in a loop with batching, trying to submit 1000 document per batch:
foreach ($item in $Items){ Set-PnPListItem ... -Batch $batch if( $Count % 1000 -eq 0) Invoke-PnPBatch -Batch $batch } }
On submitting a second batch we are getting 20 lines the same error (batch size here is 10):
The 'Type' attribute is invalid - The value 'Object[]' is invalid according to its datatype 'http://schemas.microsoft.com/sharepoint/clientquery/2009:MethodParameterTypeType' - The Enumeration constraint failed. 200 https://...
Tried to use -Force, the same
Is it a bug? is there a workaround?
just to be sure, do you call $batch = New-PnPBatch
after every invokation of Invoke-PnPBatch -Batch $batch
? as I think you need a brand new batch object after you have submitted it with Invoke-PnPBatch
Yes, I've tried. It says in doc, you cannot submit twice (not sure what that means) Also tried adding $batch = $null before re-declaring, all with no difference. The feature can really save us lot's time as we are migrating 2m records, any other ideas? Thanks!
This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days
@soaway - Sorry for the delay. We've closed a couple of issues related to batch, if the problem continues, please open a new issue with all the details. Thank you.
Thanks for following up, Veronica.