$role = $_.DisplayName seems to be case sensitive At least I was not able to retrieve data with a lower case displayName. After changing the first letter to a capital DisplayName I could retrieve the Role of each Member. Please check and verify.
Thanks.
I used this version of the Module bit outdated
Get-InstalledModule Microsoft.Graph.Users
Version Name Repository Description
------- ---- ---------- -----------
1.12.3 Microsoft.Graph.Users PSGallery Microsoft Graph PowerShell Cmdlets
$role = $_.DisplayName seems to be case sensitive At least I was not able to retrieve data with a lower case displayName. After changing the first letter to a capital DisplayName I could retrieve the Role of each Member. Please check and verify. Thanks.
I used this version of the Module bit outdated