I am new to PowerCLI and PowerShell. I have tried to go through the API list but am having trouble with (what I think should be a simple thing) coming up with details about a given VM.
If I write a script that identifes all the $vm objects on a specific host, what properties are available on that object? I've identified so far $vm.name and $vm.id
Is there a script out there already that will list all the details about a specific VM? This would help me to see what kind of information is available.
Thanks!
-Tim
I've found the easiest when starting out is to explore your actual objects. You can explore your available properties of VM's like this:
$vm = Get-VM vmname | get-view
Then type $vm
You'll then get a return of all the properties available. To dig further just type:
$vm.
then hit tab or type a property name that you saw from when you typed $vm
for example
$vm.summary
so forth and so on.
K. Chris Nakagaki (Zsoldier)
I've found the easiest when starting out is to explore your actual objects. You can explore your available properties of VM's like this:
$vm = Get-VM vmname | get-view
Then type $vm
You'll then get a return of all the properties available. To dig further just type:
$vm.
then hit tab or type a property name that you saw from when you typed $vm
for example
$vm.summary
so forth and so on.
K. Chris Nakagaki (Zsoldier)
Wow! This is great! I assume I could use this same thing on other objects like hosts?
I've found the easiest when starting out is to explore your actual objects. You can explore your available properties of VM's like this:
$vm = Get-VM vmname | get-view
Then type $vm
You'll then get a return of all the properties available. To dig further just type:
$vm.
then hit tab or type a property name that you saw from when you typed $vm
for example
$vm.summary
so forth and so on.
K. Chris Nakagaki (Zsoldier)
Yup, exactly. I focused on hosts in a post that explains this idea.
http://tech.zsoldier.com/2009/09/exploring-vmware-api-using-powercli-get.html
K. Chris Nakagaki (Zsoldier)
Thank you so much! I found exactly the value I was looking for ($vm.MoRef.Value).
-Tim