microsoftgraph / microsoftgraph/msgraph-sdk-powershell
Import-Module Microsoft.Graph.Authentication 2.34.0 Error GetTokenAsync
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 898
- Forks
- 230
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 31
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_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Microsoft.Graph.Authentication module and the Microsoft.Graph.PowerShell.Authentication.Core.Utilities.UserProvidedTokenCredential type named in the error. Compare the 2.34.0 and 2.33.0 assemblies or source around GetTokenAsync, then reproduce the import under Windows PowerShell 5.1. Done means Microsoft.Graph.Authentication imports without the TypeLoadException in the reported environment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- authentication, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100