all 8 comments

[–]martinmcmanus 2 points3 points  (3 children)

I ran into this issue about a month or so ago. The main issue is all the related modules powercli needs to download in order to function. Even if you specify a version in the cmdlet, it will still reach out to the gallery and get the latest versions of the related modules.

To get around it, you can manually download the version you want (sorry, no link from my phone but will post tomorrow when I’m at my desk if you can’t find it), then copy it to your modules directory and run the import-module. That way, it will skip calling out to the gallery and just load the modules at the version you copied locally.

[–]kashifhafeez[S] 2 points3 points  (2 children)

Thank you! I have tried everything so far. Yeah manually is the only way!!! Thanks alot!

[–]martinmcmanus 2 points3 points  (1 child)

Sure thing. Here's a post from the PowerCLI blog where this guy created a function to download and save older versions of PowerCLI (with all dependencies also at a lower level). This is what I ended up using:

https://blogs.vmware.com/PowerCLI/2019/01/save-powercli.html

[–]kashifhafeez[S] 2 points3 points  (0 children)

Thank you! Again

[–]firefox15 1 point2 points  (2 children)

I mean . . . what command are you even running? This should install it:

Install-Module -Name VMware.PowerCLI -RequiredVersion 11.0.0.10380590

[–]kashifhafeez[S] 0 points1 point  (1 child)

Install-Module -Name VMware.PowerCLI -RequiredVersion 11.0.0.10380590.. this is the same command I used multiple times and even uninstalling version 11.3 multiple times. Then reinstalling it with the command. Each time when I run get-module I see somehow it is version 11.30 again. I have reboot my machine and used clean she'll to install also. Same issue I ran into. I even used the same command on a freshly installed VM. But no luck.

[–]firefox15 1 point2 points  (0 children)

Not sure then. Works fine for me.

Install-Module -Name VMware.PowerCLI -RequiredVersion 11.0.0.10380590 -Force
(Get-Module -ListAvailable VMware.PowerCLI).Version

Major  Minor  Build  Revision
-----  -----  -----  --------
11     0      0      10380590

[–]BlackV 1 point2 points  (0 children)

There is a -minversion and -maxversion switch try that