Description
Describe the bug
Install-Module Microsoft.Entra
Install-Module Microsoft.Graph
The above fails, and the -AllowClobber
parameter only postpones the installation error until module load-time or execution time. If any other modules/cmdlets depend on a different version of Microsoft.Graph, any Entra modules simply won't load (assembly conflicts).
The issue is caused by the Entra modules having an explicit dependency on Microsoft.Graph's corresponding modules' 2.25.0 (as of Microsoft.Entra 1.0.6), and Microsoft.Graph already has newer versions available (with bug fixes and new features).
These issues cannot be resolved by the consumer unless manually editing the installed modules' manifests to allow other versions.
Resolution:
The module declarations have to move from RequiredVersion to ModuleVersion
# Microsoft.Entra.*.psd1:
# These are currently the relevant parts in the declarations:
# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'Microsoft.Graph.{*ModuleName*}'; RequiredVersion = '2.25.0'; })
# Instead, it should be:
RequiredModules = @(@{ModuleName = 'Microsoft.Graph.{*ModuleName*}'; ModuleVersion = '2.25.0'; MaximumVersion = '2.99.99'; })
See about_Module_Manifests - RequiredModules | Microsoft Learn.
This should be a simple fix.