Retention policies should be the best solution here, have you done some troubleshooting on that part?
PowerShell on its own won't help you, as Microsoft removed the Search-Mailbox cmdlet a while back. The "alternative" is inadequate for such scenarios, and won't get you anywhere, but for the sake of completeness, here it is: https://learn.microsoft.com/en-us/purview/ediscovery-search-for-and-delete-email-messages
On the positive side, New-ComplianceSearch/Action does allow you to target specific folders. And you can indeed script a loop that deletes items at batches of 10... it's just slow and annoying. Here's a sample script just in case: https://practical365.com/compliance-search-purge/
Instead, I would suggest you use an EWS-based or Graph API based script. This one is a good starting point: https://github.com/David-Barrett-MS/PowerShell-EWS-Scripts/wiki/Merge-MailboxFolders.ps1