question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import module fails in PS7 rc2 when Az module is imported first

See original GitHub issue

Steps to reproduce

What steps can reproduce the defect? Please share the setup, commandline for vstest.console, sample project, target framework etc.

PS C:\Users\<user>> Import-module Az
PS C:\Users\<user>> Import-Module PartnerCenter -Debug
VERBOSE: Loading module from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\PartnerCenter.psd1'.

Confirm
Continue with this operation?
[Y] Yes  [A] Yes to All  [H] Halt Command  [S] Suspend  [?] Help (default is "Y"): a
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Store.PartnerCenter.PowerShell.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Store.PartnerCenter.PowerShell.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.ApplicationInsights.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.ApplicationInsights.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Azure.Management.Billing.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Azure.Management.Billing.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Azure.Management.Subscription.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Azure.Management.Subscription.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Graph.Beta.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Graph.Beta.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Graph.Core.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Graph.Core.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Caching.Abstractions.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Caching.Abstractions.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Caching.Memory.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Caching.Memory.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Configuration.Abstractions.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Configuration.Abstractions.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Configuration.Binder.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Configuration.Binder.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Configuration.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Configuration.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Configuration.EnvironmentVariables.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Configuration.EnvironmentVariables.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.DependencyInjection.Abstractions.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.DependencyInjection.Abstractions.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Logging.Abstractions.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Logging.Abstractions.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Logging.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Logging.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Options.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Options.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Primitives.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Extensions.Primitives.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Identity.Client.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Identity.Client.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Identity.Client.Extensions.Msal.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Identity.Client.Extensions.Msal.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.IdentityModel.JsonWebTokens.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.IdentityModel.JsonWebTokens.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.IdentityModel.Logging.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.IdentityModel.Logging.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.IdentityModel.Tokens.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.IdentityModel.Tokens.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Rest.ClientRuntime.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Rest.ClientRuntime.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Store.PartnerCenter.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Store.PartnerCenter.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\System.Runtime.CompilerServices.Unsafe.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\System.Runtime.CompilerServices.Unsafe.dll'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\Users\<user>\Documents\PowerShell\Modules\PartnerCenter\3.0.5\Microsoft.Store.PartnerCenter.PowerShell.format.ps1xml'.
Import-Module: Assembly with same name is already loaded


PS C:\Users\<user>> Get-Module -ListAvailable -Name Az


    Directory: C:\Program Files\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     3.1.0                 Az                                  Core,Desk

    Directory: C:\Program Files\WindowsPowerShell\Modules

Expected behavior

Share the expected output

Actual behavior

What is the behavior observed?

Diagnostic logs

Please share test platform diagnostics logs.
The logs may contain test assembly paths, kindly review and mask those before sharing.

Environment

Please share additional details about your environment. Version

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, Mar 3, 2020

The required code changes have been made. Right now we are targeting this coming Friday for the next official release that will include a resolution for this issue.

0reactions
cblackukcommented, Jun 2, 2020

Also tried PS7 preview - no change there…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to install Az powershell module with PS7 on ...
Trying to install az module over existing modules will give this error and it appears to be the cause for this issue.
Read more >
Cannot install powershell modules - Microsoft Q&A
My problem is that I am not able to install modules to my powershell console. Example: Install-module -Name AzureAD.
Read more >
Import-Module Azure fails - powershell
When I open just a plain PS window and do Import-Module Azure it fails with: import-module : The specified module 'Azure' was not...
Read more >
MSOnline Module - Installation and Troubleshooting
How to install the MSOnline module and fix the most common errors. If installation of MSOnline fails follow the steps in this guide...
Read more >
How to install the PowerShell 7 Active Directory module
Officially, the Active Directory module for PowerShell 7 is only ... The module is automatically imported when you run the first command.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found