VMware Cloud Community
ryantho
Contributor
Contributor

PowerCLI taking very long to import

I just uninstalled PowerCLI 11 and installed 12 (couldn't do update-module because of signing issues), and now it takes 5 minutes to import-module. I tried the steps recommended in the following thread, but no luck: https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/quot-Import-Module-VMware-PowerCLI-quo...

I'm also not thrilled to see that's the solution. Why is it taking so long? What else can I do to try to fix it?

0 Kudos
3 Replies
LucD
Leadership
Leadership

Is the station where you do the Import-Module isolated from the Internet?
Did you check if there are timeouts when the modules are trying to connect to verify the certificate?
Did you do an IMport-Module -Name VMware.PowerCLI?
SInce 12.* that includes quite a bit of modules to be loaded(compared to 11.*).
Do you need all those modules?
Try importing only the modules you need for your code.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
ryantho
Contributor
Contributor

The PC I'm using does have internet access. I did notice that there are a lot more modules in PowerCLI in 12. I use quite a bit of PowerCLI commands in some of my scripts, so I usually do import-module vmware.powercli as a catch all. I suppose I can identify the exact modules I need rather than using the manifest. However, taking 6+ minutes to load PowerCLI seems a bit ridiculous.

0 Kudos
LucD
Leadership
Leadership

When you are using the most common cmdlets, you definitely do not need to load all PowerCLI modules.
Investing a bit of time to find out which modules actually need to be loaded, saves you a lot of time later.

Taking into account the number of modules, and the certificate checking for the signed modules, does require some time I'm afraid.

If you find it "ridiculous" I suggest opening an SR.
There are ways to limit the number of modules depending on the environment you're working in.
Perhaps the PowerCLI Dev Team might investigate and officialise those methods.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos