VMware Cloud Community
jvm2016
Hot Shot
Hot Shot

loading powercli on powershell

Hi Luc,

i need to prepare  few environments so that powercli can be loaded to powershell.

iam following your blog

Universal PowerCLI Loader - LucD notes

can yu suggest if your  function works with

pastedImage_1.png

i am not sure if this is installed from powershell gallery .

0 Kudos
7 Replies
LucD
Leadership
Leadership

Yes, that function should work with 6.5 R1

BUT, you should really consider moving to a more recent version of PowerCLI!
From PowerCLI 6.5.1 (that comes after 6.5 R1) onwards the modules are installed from the PowerShell Gallery.

And more importantly, the modules will be installed in the "normal" folders (depending on the Scope which one), where PowerShell expects them to be.
With the module auto loader (introduced in PSv4), a module will be loaded automatically once you use the 1st cmdlet from that module.

To upgrade see Welcome PowerCLI to the PowerShell Gallery – Install Process Updates

In short:

  • uinstall the PowerCLI 6.5 R1 MSI
  • remove all folders that are left
  • Install-Module from the Gallery


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

0 Kudos
jvm2016
Hot Shot
Hot Shot

iam getting foolowing error when i run this though powercliis installed.

pastedImage_0.png

0 Kudos
LucD
Leadership
Leadership

Ok, I stand corrected, the function doesn't work with PowerCLI 6.5 R1.

And I'm not planning to update the function for an older PowerCLI version.

Again, I strongly advise to upgrade your PowerCLI version.


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

0 Kudos
jvm2016
Hot Shot
Hot Shot

thnaks i am going to get powercli 10 and with powershellversion 4 it should auto detect powercli commands .

0 Kudos
LucD
Leadership
Leadership

Good idea, but why PowerShell v4, and not PowerShell v5.1?


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

0 Kudos
jvm2016
Hot Shot
Hot Shot

right now 4.0 is already installed .i think powercli 10 is fully compatible with powershell 10 .

or am i going to miss anything in powershell 4.

its sometimes tough to make changes even though it is going to make our life easy .

0 Kudos
LucD
Leadership
Leadership

Yes, PowerCLI 10.* supports Windows 10, but the latest version is now 11.0.0

For the additions in PowerShell v5, see What's New in Windows PowerShell 5.0

One difference in v5 is how the modules are stored, the path now includes the modules version number.


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

0 Kudos