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

[FEATURE] Add Page Size Option to Get-PnPFolderItem to Address ListView Threshold Limitations #4465

Open
svermaak opened this issue Oct 21, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@svermaak
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Yes, the problem is specifically related to SharePoint Online's ListView Threshold, which limits the number of items that can be retrieved in a single query. When using the Get-PnPFolderItem cmdlet without a page size option, requests often fail with an error stating that the operation "exceeds the list view threshold." This issue is particularly prevalent in large document libraries, where attempting to retrieve all items in a folder in one go is not feasible. The lack of pagination support in the Get-PnPFolderItem cmdlet leads to script failures and limits automation capabilities in large-scale SharePoint environments.

Describe the solution you'd like
The ideal solution is to enhance the Get-PnPFolderItem cmdlet with a -PageSize parameter that specifies the number of items to retrieve per request. This addition would allow users to effectively manage and circumvent the list view threshold limit by fetching items in smaller, more manageable batches. Implementing pagination within the cmdlet would not only prevent errors related to exceeding the threshold but also improve script stability and efficiency when dealing with large volumes of items.

Describe alternatives you've considered
Currently, the sole workaround we are aware of involves utilizing the Get-PnPListItem cmdlet to fetch all items initially and then applying filters after the data has been retrieved. This method, while feasible, is less efficient and can be cumbersome, especially with large datasets.

Additional context
Incorporating a page size option directly into the Get-PnPFolderItem cmdlet would significantly enhance its functionality by making it more versatile and capable of handling large datasets efficiently. This feature would align with best practices for interacting with SharePoint Online and ensure that scripts remain robust and performant, even in environments with extensive document libraries.

@svermaak svermaak added the enhancement New feature or request label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant