microsoftgraph / msgraph-sdk-powershell

Powershell SDK for Microsoft Graph
https://www.powershellgallery.com/packages/Microsoft.Graph
Other
674 stars 156 forks source link

PS: import-module microsoft.graph takes FOREVER #2808

Open GeldHades27355 opened 1 week ago

GeldHades27355 commented 1 week ago

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? 😉)

SeniorConsulting commented 3 days ago

I have a couple of questions: 1) Do you have verbose logging turned on? 2) 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.

GeldHades27355 commented 2 days ago
  1. no, all default
  2. 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.