[SPO] Remove items from list with list-view threshold reached and then remove items from recycle bin

OK, so following my post from September 8th, 2021: [SPO] Delete document library folder contents using PNP PowerShell 

I got asked what can we do if we have a list/library that is over the normal list-view threshold.

Well, here’s a script that can help:

As you can see, the script works in “bathes” of items then moves the items to the recycle bin.

So, here’s a way to remove the items from the recycle bin:

If you monitor the recycle bin items in the site contents, you will see the number decrease:

Until it reaches 0 (zero):

Hint: if you want to bulk generate a large number of items and then upload them to SharePoint, you can use: 

Enjoy!