Powershell hangs on Get-PnPListItem foreach

Copper Contributor

Hi All
I am trying to get a list of largest files or files with too many versions, so I am using $list = Get-PnPListItem , but it hangs on foreach($item in $list) as the folder has about 300000 items.
So is there any way to overcome this issue (do it in chunks etc)?
Thanks

0 Replies