Forum Discussion

PeterJ_Inobits's avatar
PeterJ_Inobits
Iron Contributor
Feb 09, 2024

Weird Error with the Microsoft.Graph SDK Module version 1.13.0

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

 

  • 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.

  • 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's avatar
        Harm_Veenstra
        MVP

        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.

Resources