PS: import-module microsoft.graph takes FOREVER
Recently, my devices need between 10-20 minutes to import microsoft.graph. While they aren't supercomputers, they're no slouches either. One of them is a Surface Pro 9 SQ3 (Arm64) and the other an Intel Core i5 11th gen. I can literally prepare a meal while the import runs. This applies to both PS5 and PS7.
Any chance to speed this up? Having to wait that long each time I use the modules is REALLY a hindrance. (multi-threaded import, anyone? 😉)
I have a couple of questions:
- Do you have verbose logging turned on?
- Are you attempting to import every single module? You might find it quicker to import specific ones as you need them - for example, Microsoft.Graph.Authentication, and Microsoft.Graph.Users.
- no, all default
- yeah, I am. I'm not an expert, just an admin with some powershell needs. 😁 So I never know which modules I'll need beforehand.
This is only an issue when I use microsoft.graph interactively.
In our code, our devs indeed only import sub-modules as needed, so it's not an issue there.
@GeldHades27355 When you work interactively, you don't need to explicitly import any of the Microsoft.Graph modules. Just run the commands you want and needed modules will be imported behind the scenes.
@GeldHades27355 When you work interactively, you don't need to explicitly import any of the Microsoft.Graph modules. Just run the commands you want and needed modules will be imported behind the scenes.
Well duh... whaddaya know? You're right of course. I guess I just outed myself as the proverbial NOOB. 🤪🤣
Issue is me, not the module - so issue closed. 😁
@GeldHades27355 There is nothing wrong with being NOOB. Everyone needs to start somewhere.