r/PowerShell • MVP, Community Blogger • Sep 24 '26

News Solving the Microsoft.Graph.Authentication Issue

Looks like Microsoft has a fix for the clash between the Microsoft.Graph.Authentication module and other modules... The interesting thing is that Microsoft has had this problem on their docket for the last 18 months, and now they get a fix from an MVP... It should be in Microsoft Graph PowerShell SDK V2.41 in a few weeks' time.

https://github.com/microsoftgraph/msgraph-sdk-powershell/pull/3789

50 Upvotes

26 comments sorted by

View all comments

Show parent comment

1

u/Unlikely_Tie1172 MVP, Community Blogger Oct 15 '26

I think you'll have to go to 2.41.2 to get the fix. However, there's nothing to stop you staying on 2.40 or earlier.

1

u/rswwalker Oct 23 '26

On 2.41.2 now and still getting the fucking error. I hate Microsoft, so, so much.

1

u/Unlikely_Tie1172 MVP, Community Blogger Oct 23 '26

Which error?

1

u/rswwalker Oct 23 '26 edited Oct 23 '26

InvalidOperation: Unable to find type [Microsoft.Graph.PowerShell.Authentication.ContextScope] when doing a Connect-Entra

Edit: Downgraded Microsoft.Graph.Authentication to 2.40.0 and no more error.

1

u/Unlikely_Tie1172 MVP, Community Blogger Oct 24 '26

That's probably because Microsoft didn't rebuild the Entra module after the initial problem was found in 2.41.0. Still, worth reporting so that they are reminded to rebuild all dependent modules.

1

u/rswwalker Oct 24 '26

Is there a tool to see what version of a dependent module a module is built against?

1

u/Unlikely_Tie1172 MVP, Community Blogger Oct 24 '26

Well, in this case, the issue is due to a bad Microsoft.Graph.Authentication module that wasn't rebuilt for the Entra module after they updated the Authentication module for Graph SDK V2.41. I bet you could take the current SDK Authentication module and it would work with the latest version of the Entra module.

There's a bunch of very interesting discussions about the innards of the assembly clashes in the various issues reported by people in GitHub. I recommend that you have a browse.

1

u/Unlikely_Tie1172 MVP, Community Blogger Oct 23 '26

Please document the issue at https://github.com/microsoftgraph/msgraph-sdk-powershell/issues. Protesting is nice, but formally documenting an issue with collaborating data is even better.

1

u/rswwalker Oct 23 '26

I will after I relax a bit, I was losing my cool trying to get work done and feeling like roadblocks are thrown up everywhere I go.

1

u/Unlikely_Tie1172 MVP, Community Blogger Oct 24 '26

Anyone working with the Graph SDK has had some days of woe in the last year. This feeling has been expressed pretty strongly to Microsoft management, some of whom promptly decamped to jobs outside Microsoft... cue for more frustration.