Getting Connection Information

Probably of use to others, I dunno, but one thing I always want to know is what all Graph, Exchange Online, or PnP PowerShell my current PowerShell session is connected to. Coz if it’s already connected I don’t need to fuss about and reconnect.

I guess there’s some way of adding it to fancy prompt engines like oh-my-posh, but all I wanted was a cmdlet I could run to view this. So I wrote up:

It’s more complicated than it needs to be, but that’s because I wanted to get output like this:

Or:

Neat, eh!