VMware

This Question is Answered

2 "helpful" answers available (6 pts)
2 Replies Last post: Aug 4, 2009 7:01 AM by Vliegenmepper  

Beginners question about "get-vm" posted: Aug 4, 2009 6:48 AM

Click to view Vliegenmepper's profile Master 1,511 posts since
May 10, 2006
Hi,

I've got a beginners question since I just dived into the PowerCli world :)

Whenever I give a "get-vm -name <name>" I get a result that displays me the: Name, PowerState, Num CPU and memory.

No I've created a very simple script:
param ( $VMHost, $VMName )
Connect-VIServer $VMHost
Get-VM -name $VMName

Whenever this is executed: ./script.ps1 <vcenterserver> <name> it gives me far more information about that specific VM.
Am I overlooking something since IMHO the "get-vm" sentences are identical.

Thanks for clearing this out to me!

Kenneth

Re: Beginners question about "get-vm"

1. Aug 4, 2009 6:57 AM in response to: Vliegenmepper
Click to view LucD's profile Champion 2,430 posts since
Oct 31, 2005
That's caused by the PS1XML file in the PowerCLI directory, called VMware.VimAutomation.Format.ps1xml.
This XML file contains the definitions how specific objects are displayed on the console.

When you execute the script other formatting rules come into play.
Rest assured the data is there.
You can add a Select-Object or Format-List cmdlet to see all the available properties.
Something like this
Get-Vm -Name <name> | Select *

or
Get-Vm -Name <name> | fl

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities