I'm banging my head against a wall trying to get this final piece written for an automatic SharePoint Online site collection script. The final piece is creating a list within the site collection (which I did), break inheritance on said list (which I did) and then remove all permissions from list (which I'm struggling with).
Look at the attached picture below. I don't need much explanation as I'm comfortable with PowerShell and CSOM, if someone has done this before I would appreciate a pointer.
I want to remove all of the permissions you see below, leaving the "1007 Owners" and "BTS 1007 Access Manager". All of the rest should be removed. Everything I've tried hasn't worked.