Why i can not add "-PageSize" to "Get-PnPFolderItem" so we can get all the folders even if we have mor than 5000 folders? #2791
Unanswered
mvcsharepointdev
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have this PnP Power-shell to loop through all sites >> then all libraries >> then list all the main folders inside the libraries.
But on some libraries we have more than 5,000 main folders. so i am trying to replace this part of the script:-
with this, so i can get the main folders in blocks :-
$SubFolders = Get-PnPFolderItem -FolderSiteRelativeUrl $Library.RootFolder.ServerRelativeUrl -ItemType "Folder" -PageSize 4999 -ScriptBlock { Param($items) $items.Context.ExecuteQuery()} | ForEach-Object {
but my last code will raise this error:-
Get-PnPFolderItem : A parameter cannot be found that matches parameter name 'PageSize'.
so how i can modify my original script to work if we have more than 5000 folders inside a library?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions