Open iserrano76 opened 1 week ago
Got the same issue on the version 3.5.0 of Exchange Online Management. The workaround remains the same.
Got the same issue on Azure Automation with Microsoft.Graph.* v2.19.0 + ExchangeOnlineManagement v3.5.0
Workaround works with Microsoft.Graph.* v2.19.0 + ExchangeOnlineManagement v3.4.0
Thanks for this!
Describe the bug
I am working in a script on PowerShell 5.1 with ExchangeOnlineManagement and Microsoft.Graph.Authentication and if I try to connect to Graph after connect to Exchange Online I received an error message:![image](https://github.com/microsoftgraph/msgraph-sdk-powershell/assets/103440830/d96cd2ff-371e-40e5-9c9c-1521a93ed801)
In the troubleshooting I found that the issue appear as well just importing the modules in the same order:![image](https://github.com/microsoftgraph/msgraph-sdk-powershell/assets/103440830/eee47a5e-9ace-48de-b205-0595c54cc691)
In case that I run in verbose mode![image](https://github.com/microsoftgraph/msgraph-sdk-powershell/assets/103440830/2508553c-2785-4aa0-9cc1-d01fdc893a0b)
Import-Module ExchangeOnlineManagement -Verbose
Import-Module Microsoft.Graph.Authentication -Verbose
If I look for the error:![image](https://github.com/microsoftgraph/msgraph-sdk-powershell/assets/103440830/e439d990-cd80-4fc2-84d5-cf46f4049d45)
It looks it is trying to look for Azure.Core on ExchangeOnlineManagement module.
if I change the order all works fine:![image](https://github.com/microsoftgraph/msgraph-sdk-powershell/assets/103440830/8643e9d4-8850-4d6e-b88a-f3ee99a31551)
Expected behavior
Be able to work with both modules, without errors and could use any order in the request.
How to reproduce
Connect-ExchangeOnline -ShowBanner:$false Connect-MgGraph -NoWelcome
Import-Module ExchangeOnlineManagement Import-Module Microsoft.Graph.Authentication
Import-Module ExchangeOnlineManagement -Verbose Import-Module Microsoft.Graph.Authentication -Verbose
SDK Version
2.19.0
Latest version known to work for scenario above?
No response
Known Workarounds
It works with PowerShell 7 or with ExchangeOnlineManagement 3.4.0
Debug output
Click to expand log
``` 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\xxxxx\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.19.0\Microsoft.Graph.Authentication.format.ps1xml'. VERBOSE: Populating RepositorySourceLocation property for module Microsoft.Graph.Authentication. VERBOSE: Loading module from path 'C:\Users\xxxxx\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.19.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\xxxxx\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.19.0\Microsoft.Graph.Authentication.Core.dll'. Import-Module : Could not load file or assembly 'file:///C:\Users\xxxxx\WindowsPowerShell\Modules\ExchangeOnlineManagement\3.5.0\netFramework\Azure.Core.dll' or one of its dependencies. The system cannot find the file specified. At line:1 char:1 + Import-Module Microsoft.Graph.Authentication -Debug + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Import-Module], FileNotFoundException + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand ```Configuration
Name Value
PSVersion 5.1.22621.3672 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.22621.3672 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
Windows 10, 11, Server 2022 x64
Other information
No response