Import-Module: Assembly with same name is already loaded

I got this while trying to load a new version of the Microsoft Graph Module.

You need to see what’s loaded to try and work out where the conflict is.

Import-Module: Assembly with same name is already loaded

If you want to see what’s loaded this gives you a very readable output.

[System.AppDomain]::CurrentDomain.GetAssemblies() | Where-Object Location | Sort-Object -Property FullName | Select-Object -Property FullName, Location, GlobalAssemblyCache, IsFullyTrusted | Out-GridView

I like the Out-Gridview version but you can remove that and just output it to the screen. You might want to pipe to

Not with Modules like AZ and Graph there are several submodules. Normally you can just use the Remove-Module cmdlet to remove them from the session and that will do. With this I had to do the following.

Remove-Module Microsoft.Graph*

Hope this helps anyone.

Leave a Reply

Your email address will not be published. Required fields are marked *