You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to delete a large (over 5000) amount of folders. The script I made works fine in a test library (only a couple of folders) but on the actual library it doesn't do anything. There are no errors, powerhell just hangs.
If I only run Get-PnPListItem -List "Files" -PageSize 500 | where-Object {$_.FieldValues.FileLeafRef -eq "Some Folder"} on my large Library, I can see all matching folders appear in batches. (Get-PnPListItem -List "Files" -PageSize 500 | where-Object {$_.FieldValues.FileLeafRef -eq "Some Folder"}).Id does not work.
This discussion was converted from issue #3632 on December 22, 2023 13:25.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I need to delete a large (over 5000) amount of folders. The script I made works fine in a test library (only a couple of folders) but on the actual library it doesn't do anything. There are no errors, powerhell just hangs.
$item = (Get-PnPListItem -List "Files" -PageSize 500 | where-Object {$_.FieldValues.FileLeafRef -eq "Some Folder"}).Id foreach($item in $item) { $item Remove-PnPListItem -List "Files" -Identity $item -Force }
If I only run
Get-PnPListItem -List "Files" -PageSize 500 | where-Object {$_.FieldValues.FileLeafRef -eq "Some Folder"}
on my large Library, I can see all matching folders appear in batches.(Get-PnPListItem -List "Files" -PageSize 500 | where-Object {$_.FieldValues.FileLeafRef -eq "Some Folder"}).Id
does not work.Again, the above all works on a small library.
Beta Was this translation helpful? Give feedback.
All reactions