question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I'm trying to add list items in a simple site.. but keep getting Invalid file name error:

See original GitHub issue

I’m trying to add list items in a simple site… but keep getting Invalid file name error:

$batch = New-PnPBatch
Add-PnPListItem -List $list -Values @{"Title" ="site1"} -Batch $batch
Add-PnPListItem -List $list -Values @{"Title" ="site2"} -Batch $batch
Add-PnPListItem -List $list -Values @{"Title" ="site3"} -Batch $batch   
$details= Invoke-PnPBatch -Batch $batch -Details

results in

Invalid file name. The file name you specified could not be used. It may be the name of an existing file or directory, or you may not have permission to access the file.

I’m using Manifest 1.2.0 PnP.PowerShell
Tested with nightly build as well: Manifest 1.2.7 PnP.PowerShell

Note: it works if I remove the batching.

_Originally posted by @bhishma in https://github.com/pnp/powershell/discussions/195_

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:34 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
jansenbecommented, Jun 2, 2021

@DaleyKD : thanks for helping out and creating the PR @ollimenzel / @rtonerii : I’ve merged the PR from @DaleyKD , this will be included in the tomorrow’s nightly build from PnP PS, so would recommend giving that a try and let us know.

1reaction
DaleyKDcommented, Jun 1, 2021

@ollimenzel : That root Site Collection was definitely the piece I was missing. I don’t know if that’s the same issue for @rtonerii or not. I’ve submitted a PR and will see if it’s accepted by @jansenbe .

Read more comments on GitHub >

github_iconTop Results From Across the Web

I'm trying to add list items in a simple site.. but keep getting ...
I'm trying to add list items in a simple site.. but keep getting Invalid file name error: $batch = New-PnPBatch Add-PnPListItem -List $list ......
Read more >
"Invalid file name" error creating folder programmatically
It may be the name of an existing file or directory, or you may not have permission to access the file. I am...
Read more >
invalid file name error when saving to OneDrive
I am getting the same "invalid file name" error that others have posted about when trying to save a Word document to OneDrive....
Read more >
"File Name Not Valid" Python Tkinter
I'm making a simple text editor and whenever I try to save a file it always gives me this error. enter image description...
Read more >
Invalid Syntax in Python: Common Reasons for SyntaxError
Python will attempt to help you determine where the invalid syntax is in your code, but the traceback it provides can be a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found