Graph PowerShell adds 4 new characters

Pat RubisPat Rubis
1 min read

There's a kind of annoying recent change to the Graph PowerShell module: to differentiate which Graph endpoint version you want to use (v1.0 or beta), you used to use Select-MgProfile and it would save the version for the session context. Now however, the commands are separated entirely, and if you want to use the beta version you need to shove in the four characters B e t a in any command you want to run. Good for your keyboard-based exercise, not so good for your efficiency.

# old way
Select-MgProfile -Name beta
Get-MgUser -Filter "displayName eq 'Pat Rubis'"

# new way
Get-MgBetaUser -Filter "displayName eq 'Pat Rubis'"

Let us hope and pray to the API gods that Microsoft don't decide to bring in a new version of the endpoint, lest they need to add another duplicate set of commands. Get-MgBravoUser, anyone?

0
Subscribe to my newsletter

Read articles from Pat Rubis directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Pat Rubis
Pat Rubis

I like tech, and sometimes I'm even good at it. This blog is a scratch space for good solutions to problems I've encountered.