SOLVED

Weird Error with the Microsoft.Graph SDK Module version 1.13.0

Iron Contributor

Hi all

I cannot get the Microsoft>Graph SDK Powershell module to work especially the User module.

When running the module within VSCode when using the get-mgbetauser cmdlet I get an error stating that the module can't be loaded twixe, When running the get-mguser cmdlet I get an error stating that object is not instantiated

 

Anyone got any ideas? 

PowerShel V 7.4..1

Microsoft.Graph version 1.13.0 

 

Any help would be appreciated. I can supply screenshots and errors grabs.

I am seeing the following error in the PowerShellCore\Operational log:

 

Error Message = Assembly with same name is already loaded
Fully Qualified Error ID = System.IO.FileLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand


Context:
Severity = Warning
Host Name = Visual Studio Code Host
Host Version = 2024.0.0
Host ID = 578c2112-e422-40bc-a34b-1fc646c895e9
Host Application = C:\Program Files\PowerShell\7\pwsh.dll -NoProfile -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\PeterJoLocal\.vscode\extensions\ms-vscode.powershell-2024.0.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2024.0.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\PeterJoLocal\.vscode\extensions\ms-vscode.powershell-2024.0.0\modules' -EnableConsoleRepl -StartupBanner "PowerShell Extension v2024.0.0

 

4 Replies
best response confirmed by Harm_Veenstra (MVP)
Solution

Had the same issue yesterday, what I did was :

  1. Close PowerShell
  2. Remove all the Microsoft Graph modules from my local OneDrive folder Documents\PowerShell\Modules"
  3. Start a new PowerShell session
  4. Install-module microsoft.graph, microsoft.graph.beta (Takes a while)


Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.

If one of the posts was helpful in other ways, please consider giving it a Like.

@Harm_Veenstra 

 

Yes it did. Kudos and thanks. 

 

It didn't even occur to me to look there....

 

 

Nice, great to hear that that fixed it for you! 

Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.

If one of the posts was helpful in other ways, please consider giving it a Like.

1 best response

Accepted Solutions
best response confirmed by Harm_Veenstra (MVP)
Solution

Had the same issue yesterday, what I did was :

  1. Close PowerShell
  2. Remove all the Microsoft Graph modules from my local OneDrive folder Documents\PowerShell\Modules"
  3. Start a new PowerShell session
  4. Install-module microsoft.graph, microsoft.graph.beta (Takes a while)


Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.

If one of the posts was helpful in other ways, please consider giving it a Like.

View solution in original post