We have a request from our auditors to provide a csv file, that contains for each document library in a site, unique permissions applied on only the first level of folders within the document library, without going into each subfolder.
I've found PnP PowerShell scripts that retrieve security for all subfolders, but couldn't find any for only top level folders.