Repository navigation
Description
Describe the bug
Import-Module Microsoft.Graph.Authentication
Import-Module : Method 'GetTokenAsync' in type
'Microsoft.Graph.PowerShell.Authentication.Core.Utilities.UserProvidedTokenCredential' from assembly
'Microsoft.Graph.Authentication.Core, Version=2.34.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not
have an implementation.
At line:1 char:1
- Import-Module Microsoft.Graph.Authentication
-
+ CategoryInfo : NotSpecified: (:) [Import-Module], TypeLoadException + FullyQualifiedErrorId : System.TypeLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand
Expected behavior
Import-Module Microsoft.Graph.Authentication does not throw an error
How to reproduce
Import-Module Microsoft.Graph.Authentication
SDK Version
2.34.0
Latest version known to work for scenario above?
2.33.0
Known Workarounds
No response
Debug output
Click to expand log
``` Import-Module Microsoft.Graph.Authentication -Debug VERBOSE: Loading module from path 'C:\Users\a.bohren\OneDrive - Icewolf\Dokumente\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.34.0\Microsoft.Graph.Authentication.psd1'.Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): A
VERBOSE: Cannot verify the Microsoft .NET Framework version 4.7.2 because it is not included in the list of permitted
versions.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\Users\a.bohren\OneDrive -
Icewolf\Dokumente\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.34.0\Microsoft.Graph.Authentication.format
.ps1xml'.
VERBOSE: Populating RepositorySourceLocation property for module Microsoft.Graph.Authentication.
VERBOSE: Loading module from path 'C:\Users\a.bohren\OneDrive -
Icewolf\Dokumente\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.34.0\Microsoft.Graph.Authentication.dll'.
VERBOSE: Importing cmdlet 'Get-ModuleCmdlet'.
VERBOSE: Importing cmdlet 'Get-ScriptCmdlet'.
VERBOSE: Importing cmdlet 'Connect-MgGraph'.
VERBOSE: Importing cmdlet 'Disconnect-MgGraph'.
VERBOSE: Importing cmdlet 'Add-MgEnvironment'.
VERBOSE: Importing cmdlet 'Get-MgEnvironment'.
VERBOSE: Importing cmdlet 'Remove-MgEnvironment'.
VERBOSE: Importing cmdlet 'Set-MgEnvironment'.
VERBOSE: Importing cmdlet 'Get-MgContext'.
VERBOSE: Importing cmdlet 'Get-MgGraphOption'.
VERBOSE: Importing cmdlet 'Invoke-MgGraphRequest'.
VERBOSE: Importing cmdlet 'Set-MgGraphOption'.
VERBOSE: Importing cmdlet 'Get-MgRequestContext'.
VERBOSE: Importing cmdlet 'Set-MgRequestContext'.
VERBOSE: Importing alias 'Connect-Graph'.
VERBOSE: Importing alias 'Disconnect-Graph'.
VERBOSE: Importing alias 'Disconnect-Graph'.
VERBOSE: Importing alias 'Disconnect-Graph'.
VERBOSE: Importing alias 'Disconnect-Graph'.
VERBOSE: Importing alias 'Disconnect-Graph'.
VERBOSE: Importing alias 'Disconnect-Graph'.
VERBOSE: Importing alias 'Disconnect-Graph'.
VERBOSE: Importing alias 'Invoke-GraphRequest'.
VERBOSE: Importing alias 'Invoke-MgRestMethod'.
VERBOSE: Importing alias 'Invoke-GraphRequest'.
VERBOSE: Importing alias 'Invoke-MgRestMethod'.
VERBOSE: Importing alias 'Invoke-GraphRequest'.
VERBOSE: Importing alias 'Invoke-MgRestMethod'.
VERBOSE: Importing alias 'Invoke-GraphRequest'.
VERBOSE: Importing alias 'Invoke-MgRestMethod'.
VERBOSE: Loading module from path 'C:\Users\a.bohren\OneDrive -
Icewolf\Dokumente\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.34.0\Microsoft.Graph.Authentication.Core.d
ll'.
Import-Module : Method 'GetTokenAsync' in type
'Microsoft.Graph.PowerShell.Authentication.Core.Utilities.UserProvidedTokenCredential' from assembly
'Microsoft.Graph.Authentication.Core, Version=2.34.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not
have an implementation.
At line:1 char:1
- Import-Module Microsoft.Graph.Authentication -Debug
-
+ CategoryInfo : NotSpecified: (:) [Import-Module], TypeLoadException + FullyQualifiedErrorId : System.TypeLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand
</details>
### Configuration
$PSVersionTable
Name Value
---- -----
PSVersion 5.1.26100.7462
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.26100.7462
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Windows 11 25H2
x64
### Other information
_No response_
Activity
BohrenAn commentedon Dec 21, 2025
It seems the Problem only affects PowerShell 5.1
PowerShell 5.1
PowerShell 7.5.4
Kind Regards
Andres
gavinbarron commentedon Dec 22, 2025
Thanks for reporting this Andres Bohren (@BohrenAn), I'm really sorry that you're being impacted here. I specifically tested this on PowerShell 5.1 prior to us releasing to try and reduce the likelihood customers having a bad time with our latest change to the Authentication module.
This suggests something environment related is going on.
Would you please be able to run the following and provide the output to help here?
As a point of comparision, here's what I get on my dev box.
BohrenAn commentedon Dec 23, 2025
Hi Gavin Barron (@gavinbarron)
Here are the Results you requested
PS C:> Install-Module Microsoft.Graph.Authentication -RequiredVersion 2.34.0 -Force
PS C:> Import-Module Microsoft.Graph.Authentication -RequiredVersion 2.34.0
Import-Module : Method 'GetTokenAsync' in type
'Microsoft.Graph.PowerShell.Authentication.Core.Utilities.UserProvidedTokenCredential' from assembly
'Microsoft.Graph.Authentication.Core, Version=2.34.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not
have an implementation.
At line:1 char:1
PS C:> Connect-MgGraph
Connect-MgGraph : The 'Connect-MgGraph' command was found in the module 'Microsoft.Graph.Authentication', but the
module could not be loaded. For more information, run 'Import-Module Microsoft.Graph.Authentication'.
At line:1 char:1
albertvannijhuis commentedon Dec 23, 2025
Hi! I'm experiencing the same issue with Microsoft.Graph.Authentication version 2.34.0 in an Azure Automation runbook using PowerShell 5.1 since this morning. The runbook worked perfectly before, but now fails with: "Method 'GetTokenAsync' in type 'Microsoft.Graph.PowerShell.Authentication.Core.Utilities.UserProvidedTokenCredential' from assembly 'Microsoft.Graph.Authentication.Core, Version=2.34.0.0' does not have an implementation."
mmcdermo2 commentedon Dec 23, 2025
We're seeing this also in our Azure DevOps pipelines running on Server 2019 / 2022 with PowerShell 5.1
On my Windows 11 local machine, where I have Windows PowerShell and PowerShell core, I don't have the issue, even with version 2.34.0
mmcdermo2 commentedon Dec 23, 2025
Sorry, I just clarify - when I said I don't have the issue on my local Windows 11 machine, I meant I don't have it on Windows PowerShell 5.1 with 2.34.0
gavinbarron commentedon Dec 23, 2025
Thanks for the additional info folks.
Given the error message, "[method] in [assembly] does not have an implementation", it's smelling a bit like a dotnet issue to me. So, I have more questions about your environments. Specifically, what versions of .NET and .NET Framework are available in your Windows PowerShell 5.1 shells.
Additionally, I'm curious as to why you all are using Windows PowerShell 5.1 instead of 7.5? Is there some blocker?
To be completely transparent here, I'm currently on leave and if mother nature plays ball, I'll be offline and skiing until the new year from tomorrow. I apologize that this new version is causing you all problems for you and we'll be working to address them when we return in the new year.
For now, I'd either pin my automation on PS5.1 to 2.33, or if possible, migrate to PS7.5, which you all should be planning on in the longer term anyway.
31 remaining items
cnschindler commentedon Mar 15, 2026
And the issue still exists in version 2.36 of the module...
BohrenAn commentedon Mar 16, 2026
Christian Schindler (@cnschindler)
Can't confirm. The Problem does not exist anymore in the 2.36 Microsoft.Graph PowerShell Module
$maximumfunctioncount = '32768'
Import-Module Microsoft.Graph
Better load only the Modules you really use
Import-Module Microsoft.Graph.Authentication
If you import the ExchangeOnline Module first - then this happens
Import-Module ExchangeOnlineManagement
The other way around works.
$maximumfunctioncount = '32768'
Import-Module Microsoft.Graph
Import-Module ExchangeOnlineManagement
But AZ PowerShell Module has a Problem then
Kind Regards
Andres
saqib-s commentedon Mar 18, 2026
I am also seeing this issue, recently installed 2.36.0 and it has started to occur.
I have tried removing the Graph modules and reinstalling, but still see the same problem. This is using Windows Powershell.
Get-InstalledModule Microsoft.Graph* | Uninstall-Module -AllVersions -ForceNo issues when using PowerShell 7.
Update*
Found that the issue for me presents itself only in the PowerShell Extension terminal in VS Code, others have seen this too and seem to think it's the way the extension is loading the modules, when using the regular PowerShell terminal windows in VS code I do not see the issue repeat itself.
zaaj commentedon Mar 27, 2026
I'm still feeling stuck on Windows Powershell as well - I need to share my scripts with co-workers, and expecting them to install non-default Powershell is a stretch, especially on servers.
My general use case is to open a Windows Terminal powershell window in the morning, and leave it open all day as I work on issues.
That session may need to connect using Az, MicrosoftTeams, ExchangeOnlineManagement, Microsoft.Graph, ActiveDirectory, PowerCLI - thankfully I've somehow escaped needing to do much in Sharepoint.
Trying to keep track of what order the various modules need to be logged into doesn't really work - I try logging in only once I need to do work in a particular service.
Opening up new powershell windows works around the problem, but the session I leave behind may well have variables loaded up with lists of accounts I'm working on, and it's common to need to compare data across modules.
Borgquite commentedon Apr 13, 2026
Same issue here, the usual assembly conflicts whenever any of the modules are updated. Have to use Windows PowerShell 5.1 as am using DSC to manage our hybrid environment, so am dependent on the LCM.
mrkmcnamee commentedon Apr 28, 2026
I ran into this issue as well using PowerShell 5.1. This is the version that is launched by default on Windows 11.
Gavin Barron (@gavinbarron) wrote:
According to the docs: "PowerShell 7 doesn't replace Windows PowerShell 5.1. It installs to a new directory and runs side-by-side with Windows PowerShell 5.1."
So, 7.5 is something that the user has to explicitly install and explicitly launch ("PowerShell 7") to use, which could explain why there are so many 5.1 users experiencing this issue.
Cheers,
Kevin
fardinbarashi commentedon Apr 30, 2026
My problem was solved by :
Uninstall module
1.1. Install-Module Uninstall-Graph
1.2. Uninstall-All
1.3. Closed all powershell terminals ( ISE/ Code etc )
Install module
2.1 Install-Module Microsoft.Graph.Authentication -RequiredVersion 2.33.0 -Repository PSGallery -Force -AllowClobber
2.2 Install-Module Microsoft.Graph -RequiredVersion 2.33.0 -Force -AllowClobber
Using Win11
FashionOu commentedon May 25, 2026
we can also reproduce the issue in 2.37.0
Ar5had07 commentedon Jun 17, 2026
I'm facing this exact issue in VSCode, but not in Terminal (version 2.38.0)
VSCode
Terminal
HorridMutilation commentedon Jul 15, 2026
I am also having the same issue in VSC but not in Terminal...
PerryVerheij commentedon Jul 21, 2026
Version 2.38.1 in PowerShell still has the bug. I had to downgrade to 2.33.0 to be able to connect to MS Graph.
tea-pope commentedon Aug 7, 2026
Can confirm this is still an issue as of the latest release. Still have to stick to 2.33 for all of Microsoft.Graph in order to use base functionality.
haydgsky commentedon Aug 10, 2026
Same issue here when loading the Exchange Module before the Graph module on 2.39 in Powershell 5.1
neilpeel13 commentedon Aug 21, 2026
Same issue in VS Code PS5.1 using Graph module v 2.39.
Seems to connect-mggraph OK when using ISE..
Was OK on previous version 2.34 - but started failing after moving to 2.39.
Module does not seem to import correctly in VS Code..
saqib-s commentedon Sep 18, 2026
Looks like this probably won't be addressed, as Microsoft have announced a twelve-month retirement period to phase out support for Graph SDK modules running on Windows PowerShell 5.1.
Microsoft also announced plans to deliver V3 of the Microsoft Graph PowerShell SDK in Q4 of 2026. SDK V3 is targeted at PowerShell V7 and will not include explicit support for Windows PowerShell 5.1. Organizations that wish to continue running Graph SDK scripts on Windows PowerShell 5.1 must remain on a V2 release because V3 will not support the older runtime.
"If you’re still on Windows PowerShell 5.1, begin planning your move to PowerShell 7.x now. It’s the recommended and only maintained platform going forward, and it delivers the more reliable experience described above."
from MS article linked above