pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets

Home Page:https://pnp.github.io/powershell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Issue] Add-PnPListItem Hanging.

Tar-rask opened this issue · comments

I don't believe it is a bug. However, recently I am running a script which loops through to Add-PnPListItem items.

It was working fine with no issues last time I ran it around two weeks ago. This is both on 3.25.2009.1 and now on 3.26.2010.0

As the script loops through to add items, eventually it will just Hang. There does not seem to be a pattern, some times after 10 items, some times after 500. (The script attempts to add ~750). So far about 4 times out of 30 the script run to completion.
There is no error reported. And I can't even Ctrl-C out of the script.

I have pin pointed it to the point in the script runs the line
Add-PnPListItem -List "$sitelistname" -Values $values
and before it returns the ID/Title/Guid when it is successful.
If anyone knows how I could debug this issue further would be great.


After some more testing. I had three powershell windows open.

  1. running script
  2. running script
  3. which i copied a thousand lines of Add-PnPListItem -List "$sitelistname" -Values ..... (to remove the script loop altogether)

Eventually, they all Hanged at the same time. The 3) copy/paste window after a short period of time (10 seconds or so) resumed, the other two windows eventually did while I was posting this update.