How can I retrieve site permissions on a site or subsite using PnP PowerShell?
Example: https://$orgName.sharepoint.com/sites/IT/Atlas
Via the UI: Site settings > Site Permissions
With PnP PowerShell, the following didn't work for me:
Connect-PnPOnline -Url "https://$orgName.sharepoint.com/sites/IT/Atlas" -Credentials $userCredential
$web = Get-PnPWeb -Includes RoleAssignments
[Edit] The above code actually seems to work, as $web.RoleAssignments.Count returns 5. My issue is that I don't know how to take it from here, to enumerate the 5 members and their roles.
RoleAssignments.Member returns 5 items but I can't figure out how to get the names and roles.
RoleAssignments.Groups only returns the SharePoint groups.