You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
This module depends on some sub-modules of microsoft.graph, but does not seem to check whether those modules are present before using them.
To Reproduce
Steps to reproduce an example issue caused by not checking dependencies
Launch Powershell 7
Import-module Microsoft.Graph.Authentication
connect-mggraph -scope user.readwrite.all
get-unmanagedexternaluser
Command returns error below due to a dependency on 'microsoft.graph.users' Unable to find type [Microsoft.Graph.PowerShell.Models.MicrosoftGraphUser1]
Expected behavior
The MSIdentityTools module should check for modules that it depends upon and import those modules if they aren't already. Ideally, this would check for and import only the specific modules or sub-modules required, and not mass import dozens of unnecessary modules by importing the parent microsoft.graph module.
Note that the documentation for the Microsoft.Graph module explicitly recommends against installing the entire microsoft.graph module, and to instead install only the specific sub-modules needed. This would also apply to which modules should be imported.
Consider adding a Requires statement listing the specific modules required. Alternatively, each function could include check for the modules it depends on within the function if the overall MSIdentityTools module would require many modules that most of the functions wouldn't need.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
OS: Windows
PowerShell 7.2.6
MS Graph SDK PowerShell Module Version 2.0.17
The text was updated successfully, but these errors were encountered:
@NeighborGeek I have updated all commands that use Mg modules to call the shared Test-MgCommand function so you should get an error now if the required modules cannot be loaded.
Describe the bug
This module depends on some sub-modules of microsoft.graph, but does not seem to check whether those modules are present before using them.
To Reproduce
Steps to reproduce an example issue caused by not checking dependencies
Unable to find type [Microsoft.Graph.PowerShell.Models.MicrosoftGraphUser1]
Expected behavior
The MSIdentityTools module should check for modules that it depends upon and import those modules if they aren't already. Ideally, this would check for and import only the specific modules or sub-modules required, and not mass import dozens of unnecessary modules by importing the parent microsoft.graph module.
Note that the documentation for the Microsoft.Graph module explicitly recommends against installing the entire microsoft.graph module, and to instead install only the specific sub-modules needed. This would also apply to which modules should be imported.
Consider adding a Requires statement listing the specific modules required. Alternatively, each function could include check for the modules it depends on within the function if the overall MSIdentityTools module would require many modules that most of the functions wouldn't need.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: