VMware Cloud Community
icehckyplyr22
Enthusiast
Enthusiast
Jump to solution

Extract cmdlets from PowerCLI for use in Windows PowerShell

I am not super familiar with PowerShell but I am trying to write a script through a remote monitoring tool we use. I want to use this script to run a report of all systems in our environment that have a snapshot.

My script downloads the PowerCLI and attempts to install quietly (not sure why this won't work) I think its because VIX wants to be installed and its not %100 silent, you have to click okay to acknowledge this. I can always script the install of VIX first but I want to make this easier. One of the other issues I find is the downloading of the large 193MB file for PowerCLI 5.5

Is is possible to just extract the two cmdlets from the package to run in Windows PowerShell?

Connect-VIServer vCenterServerName


get-vm | get-snapshot | format-list




If so this would make my life much easier Smiley Happy

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

I'm afraid you can't just install 2 PowerCLI cmdlets.

The PowerCLI PSSnapin is a collection of DLLs with interdependencies.

But you should be able to install PowerCLI silently together with VIX.

Have a look at solution 2 in this ITNinja article.


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

View solution in original post

0 Kudos
9 Replies
LucD
Leadership
Leadership
Jump to solution

I'm afraid you can't just install 2 PowerCLI cmdlets.

The PowerCLI PSSnapin is a collection of DLLs with interdependencies.

But you should be able to install PowerCLI silently together with VIX.

Have a look at solution 2 in this ITNinja article.


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

0 Kudos
icehckyplyr22
Enthusiast
Enthusiast
Jump to solution

Testing now, thanks!

0 Kudos
icehckyplyr22
Enthusiast
Enthusiast
Jump to solution

That worked, I pulled the MSI's from the %Temp% and just used the /quiet thanks again!

0 Kudos
icehckyplyr22
Enthusiast
Enthusiast
Jump to solution

I can't seem to script this install. It only works when a user is logged in. This is becoming quite frustrating. I wish I could just extract the two simple items I need. connect-viserver & get-vm get-snapshot

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Which msiexec parameters did you use ?

Did you activate logging (the /l parameter) ? Any clues in the logs ?


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

0 Kudos
icehckyplyr22
Enthusiast
Enthusiast
Jump to solution

So the VIX installs fine its the PowerCLI that doesnt run

msiexec /i "C:\VMware vSphere PowerCLI.msi"  is the command I used

I even tried

msiexec /i "C:\VMware vSphere PowerCLI.msi" /qn /quiet

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Can you try to add "/l*v c:\powercli.log" on the msiexec command ?


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

icehckyplyr22
Enthusiast
Enthusiast
Jump to solution

okay that worked haha!!

0 Kudos
LucD
Leadership
Leadership
Jump to solution

So it did install then ?


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

0 Kudos