Az and AzureStack (Az) modules do not load assemblies when used with PartnerCenter modules in PS7 - Assembly with same name is already loaded
See original GitHub issueSteps to reproduce
PS /> Get-Module -ListAvailable -Name Az.*,Azs.*,Partner*
Directory: /root/.local/share/powershell/Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 2.0.1 preview Az.Accounts Core,Desk {Disable-AzDataCollection, Disable-AzCo…
Script 1.8.1 Az.Accounts Core,Desk {Disable-AzDataCollection, Disable-AzCo…
Script 0.1.0 preview Az.BootStrapper Core,Desk {Update-AzProfile, Uninstall-AzProfile,…
Script 2.0.0 Az.KeyVault Core,Desk {Add-AzKeyVaultCertificate, Update-AzKe…
Script 0.10.0 preview Az.Resources Core,Desk {Get-AzProviderOperation, Remove-AzRole…
Script 0.9.0 preview Azs.Backup.Admin Core,Desk {Get-AzsBackup, Get-AzsBackupConfigurat…
Script 0.9.0 preview Azs.Commerce.Admin Core,Desk Get-AzsSubscriberUsage
Script 0.9.0 preview Azs.Compute.Admin Core,Desk {Add-AzsPlatformImage, Add-AzsVMExtensi…
Script 0.9.0 preview Azs.Deployment.Admin Core,Desk {Invoke-AzsProductExecuteRunnerAction, …
Script 0.9.0 preview Azs.Fabric.Admin Core,Desk {Add-AzsScaleUnitNode, Disable-AzsScale…
Script 0.9.0 preview Azs.Gallery.Admin Core,Desk {Add-AzsGalleryItem, Get-AzsGalleryItem…
Script 0.9.0 preview Azs.Network.Admin Core,Desk {Get-AzsLoadBalancer, Get-AzsNetworkAdm…
Script 0.9.0 preview Azs.Storage.Admin Core,Desk {Get-AzsStorageAccount, Get-AzsStorageA…
Script 0.9.0 preview Azs.Subscriptions Core,Desk {Get-AzsDelegatedProviderOffer, Get-Azs…
Script 0.9.0 preview Azs.Subscriptions.Admin Core,Desk {Add-AzsPlanToOffer, Get-AzsAcquiredPla…
Script 0.9.0 preview Azs.Update.Admin Core,Desk {Get-AzsUpdate, Get-AzsUpdateLocation, …
Directory: /usr/local/share/powershell/Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 3.0.9 PartnerCenter Core,Desk {Add-PartnerCustomerCartLineItem, Add-P…
PS /> cat /etc/issue
Ubuntu 18.04.4 LTS \n \l
PS /> $PSVersionTable
Name Value
---- -----
PSVersion 7.0.1
PSEdition Core
GitCommitId 7.0.1
OS Linux 4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
PS /> Import-Module AzureStack
Import-Module: The required module 'Azs.AzureBridge.Admin' is not loaded. Load the module or remove the module from 'RequiredModules' in the file '/root/.local/share/powershell/Modules/AzureStack/2.0.0/AzureStack.psd1'.
PS /> Import-Module /root/.local/share/powershell/Modules/Azs.Azurebridge.Admin/0.9.0/Azs.AzureBridge.Admin.psd1 -verbose
VERBOSE: Loading module from path '/root/.local/share/powershell/Modules/Azs.Azurebridge.Admin/0.9.0/Azs.AzureBridge.Admin.psd1'.
VERBOSE: Loading 'Assembly' from path '/root/.local/share/powershell/Modules/Azs.Azurebridge.Admin/0.9.0/bin/Azs.AzureBridge.Admin.private.dll'.
VERBOSE: Loading 'Executable' from path '/root/.local/share/powershell/Modules/Azs.Azurebridge.Admin/0.9.0/bin/Azs.AzureBridge.Admin.private.dll'.
VERBOSE: Loading 'FormatsToProcess' from path '/root/.local/share/powershell/Modules/Azs.Azurebridge.Admin/0.9.0/Azs.AzureBridge.Admin.format.ps1xml'.
VERBOSE: Populating RepositorySourceLocation property for module Azs.AzureBridge.Admin.
VERBOSE: Loading module from path '/root/.local/share/powershell/Modules/Azs.Azurebridge.Admin/0.9.0/Azs.AzureBridge.Admin.psm1'.
VERBOSE: Importing function 'Get-AzsAzureBridgeActivation'.
VERBOSE: Importing function 'Get-AzsAzureBridgeDownloadedProduct'.
VERBOSE: Importing function 'Get-AzsAzureBridgeProduct'.
VERBOSE: Importing function 'Invoke-AzsAzureBridgeProductDownload'.
VERBOSE: Importing function 'Remove-AzsAzureBridgeDownloadedProduct'.
PS /> Import-Module /root/.local/share/powershell/Modules/Azs.Infrastructureinsights.Admin/0.9.0/Azs.InfrastructureInsights.Admin.psd1 -Verbose
VERBOSE: Loading module from path '/root/.local/share/powershell/Modules/Azs.Infrastructureinsights.Admin/0.9.0/Azs.InfrastructureInsights.Admin.psd1'.
VERBOSE: Loading 'Assembly' from path '/root/.local/share/powershell/Modules/Azs.Infrastructureinsights.Admin/0.9.0/bin/Azs.InfrastructureInsights.Admin.private.dll'.
VERBOSE: Loading 'Executable' from path '/root/.local/share/powershell/Modules/Azs.Infrastructureinsights.Admin/0.9.0/bin/Azs.InfrastructureInsights.Admin.private.dll'.
VERBOSE: Loading 'FormatsToProcess' from path '/root/.local/share/powershell/Modules/Azs.Infrastructureinsights.Admin/0.9.0/Azs.InfrastructureInsights.Admin.format.ps1xml'.
VERBOSE: Populating RepositorySourceLocation property for module Azs.InfrastructureInsights.Admin.
VERBOSE: Loading module from path '/root/.local/share/powershell/Modules/Azs.Infrastructureinsights.Admin/0.9.0/Azs.InfrastructureInsights.Admin.psm1'.
VERBOSE: Importing function 'Close-AzsAlert'.
VERBOSE: Importing function 'Get-AzsAlert'.
VERBOSE: Importing function 'Get-AzsRegionHealth'.
VERBOSE: Importing function 'Get-AzsRegistrationHealth'.
VERBOSE: Importing function 'Get-AzsRPHealth'.
VERBOSE: Importing function 'Repair-AzsAlert'.
PS /> Import-Module /root/.local/share/powershell/Modules/Azs.Keyvault.Admin/0.9.0/Azs.KeyVault.Admin.psd1 -verbose
VERBOSE: Loading module from path '/root/.local/share/powershell/Modules/Azs.Keyvault.Admin/0.9.0/Azs.KeyVault.Admin.psd1'.
VERBOSE: Loading 'Assembly' from path '/root/.local/share/powershell/Modules/Azs.Keyvault.Admin/0.9.0/bin/Azs.KeyVault.Admin.private.dll'.
VERBOSE: Loading 'Executable' from path '/root/.local/share/powershell/Modules/Azs.Keyvault.Admin/0.9.0/bin/Azs.KeyVault.Admin.private.dll'.
VERBOSE: Loading 'FormatsToProcess' from path '/root/.local/share/powershell/Modules/Azs.Keyvault.Admin/0.9.0/Azs.KeyVault.Admin.format.ps1xml'.
VERBOSE: Populating RepositorySourceLocation property for module Azs.KeyVault.Admin.
VERBOSE: Loading module from path '/root/.local/share/powershell/Modules/Azs.Keyvault.Admin/0.9.0/Azs.KeyVault.Admin.psm1'.
VERBOSE: Importing function 'Get-AzsKeyvaultQuota'.
PS />
PS /> Import-Module AzureStack
WARNING: Preview version of AzureStack module is loaded, Future versions may have breaking changes
PS /> Import-Module PartnerCenter
Import-Module: Assembly with same name is already loaded
PS /> Get-Module
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 2.0.1 preview Az.Accounts {Add-AzEnvironment, Clear-AzContext, Clear-AzDefa…
Script 0.10.0 preview Az.Resources {Add-AzADGroupMember, Export-AzResourceGroup, Get…
Script 0.9.0 preview Azs.AzureBridge.Admin {Get-AzsAzureBridgeActivation, Get-AzsAzureBridge…
Script 0.9.0 preview Azs.Backup.Admin {Get-AzsBackup, Get-AzsBackupConfiguration, Resto…
Script 0.9.0 preview Azs.Commerce.Admin Get-AzsSubscriberUsage
Script 0.9.0 preview Azs.Compute.Admin {Add-AzsPlatformImage, Add-AzsVMExtension, Get-Az…
Script 0.9.0 preview Azs.Deployment.Admin {Get-AzsActionPlan, Get-AzsActionPlanAttempt, Get…
Script 0.9.0 preview Azs.Fabric.Admin {Add-AzsScaleUnitNode, Disable-AzsScaleUnitNode, …
Script 0.9.0 preview Azs.Gallery.Admin {Add-AzsGalleryItem, Get-AzsGalleryItem, Remove-A…
Script 0.9.0 preview Azs.InfrastructureInsights.Admin {Close-AzsAlert, Get-AzsAlert, Get-AzsRegionHealt…
Script 0.9.0 preview Azs.KeyVault.Admin Get-AzsKeyvaultQuota
Script 0.9.0 preview Azs.Network.Admin {Get-AzsLoadBalancer, Get-AzsNetworkAdminOverview…
Script 0.9.0 preview Azs.Storage.Admin {Get-AzsStorageAccount, Get-AzsStorageAcquisition…
Script 0.9.0 preview Azs.Subscriptions {Get-AzsDelegatedProviderOffer, Get-AzsOffer, Get…
Script 0.9.0 preview Azs.Subscriptions.Admin {Add-AzsPlanToOffer, Get-AzsAcquiredPlan, Get-Azs…
Script 0.9.0 preview Azs.Update.Admin {Get-AzsUpdate, Get-AzsUpdateLocation, Get-AzsUpd…
Script 2.0.0 preview AzureStack
Manifest 7.0.0.0 Microsoft.PowerShell.Management {Add-Content, Clear-Content, Clear-Item, Clear-It…
Manifest 7.0.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Ob…
Script 2.0.0 PSReadLine {Get-PSReadLineKeyHandler, Get-PSReadLineOption, …
PS />
Expected behavior
Modules should work side by side.
Actual behavior
Error message
Import-Module: Assembly with same name is already loaded
Environment
Tested on: Ubuntu18 CentOS7 WinServerCore2019
PS7.0.x PS7.1.x (beta) PowerShellGet 2.x.x PowerShellGet 3.0 (beta)
This basically defeats the purpose of Az modules because you cannot use them in PS Core.
Note: It all works fine in PS5.1
See https://github.com/microsoft/Partner-Center-PowerShell/issues/261 for additional info.
@isaiahwilliams Can we please look into this? I need this to work so I can switch to Linux containers. Please help!
Bonus: Ignore the fact that AzureStack module does not load properly in Linux - it loads fine on Windows… and you can see a workaround for Linux above anyway.
To reiterate as you can see below - loading AzureStack and PartnerCenter does not work whichever way you try. You can try AzureStack then PartnerCenter or vice versa and it is still broken.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Yeah these will work:
Problem is with the ones that AzureStack is using… Thanks though 😃 @slavizh
I am able to import them but I use only the Az modules and the Partner Center module. I am also using the GA version rather the previews. Here is my information if it helps for this case in some way.