For local AD you can easily obtain your current group memberships via CLI but for Office 365 \ Azure Active Directory, this seems to require Get-MSOL for pretty much everything.
That requires the MSOnline Azure module to be installed and when the script runs the user will be visually prompted for O365 credentials.
Not sure if there’s any way around this.
Ideally, there would be some sort of credential digest that feeds the currently signed in AAD user credential to MSOL allowing the script to bypass the pop-up.
Any ideas? Thank you!