Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Reolve-PnPFolder or Add-PnPFolder does not work above 5000 items in a list - list view threshold #1438

Closed
1 of 6 tasks
LeonArmston opened this issue Dec 13, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@LeonArmston
Copy link
Contributor

LeonArmston commented Dec 13, 2021

Reporting an Issue or Missing Feature

Working with a large document library (5000+ items) and my code pre-creates a folder before I add files.

I have tried Resolve-PnPFolder and Add-PnpFolder and both get the following error message whenever I try to run the code "The attempted operation is prohibited becuase it exceeds the list view threshold.

To create the folder as a workaround I have to revert to pure csom

$context = Get-PnPContext
$folder =$context.Web.folders.add("ResearchDB/700E004E1219A627FFFE0000FFFE8025")
$context.ExecuteQuery()

I think the PnP folder commands do a pre check whether the folder exists and this fails when the item limit on the list is over 5000 wheras the pure csom does not do a pre-check. Wondering if anything can be done?

Thanks so much

Expected behavior

New Folder is created or existing folder is resolved

Actual behavior

image

image

Steps to reproduce behavior

Please include complete script or code samples in-line or linked from gists

#Add more than 5000 items to a document library

$folderpath = "ResearchDB/700E004E1219A627FFFE0000FFFE8025"

Resolve-PnPFolder -SiteRelativePath $folderPath

#or

Add-PnPFolder -Name "700E004E1219A627FFFE0000FFFE8025" - Folder ResearchDB"

What is the version of the Cmdlet module you are running?

(you can retrieve this by executing Get-Module -Name "PnP.PowerShell" -ListAvailable)
1.8.0
Apologies if this has been fixed in a recent release - the client VM I'm working on will not allow me to install -PreRelease

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
@LeonArmston LeonArmston added the bug Something isn't working label Dec 13, 2021
@gautamdsheth
Copy link
Collaborator

Added a fix in PnP Framework to fix issue with adding folders in large lists.

pnp/pnpframework#559

Will close this, once it is merged.
Currently , folder is created correctly but there is error while retrieving it.

@LeonArmston
Copy link
Contributor Author

Awesome - thanks @gautamdsheth

@veronicageek
Copy link
Collaborator

Closing as the PR has been merged on the PnPFramework repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants