Hi there,
i've two (simple) questions. Maybe anybody can give me an (simple) answer 🙂
This is the statement:
$vm | select Name, @{N="IPAddress"; E={ $_ | Get-VMGuest | select -ExpandProperty IP*}}
The Questions.
1. Why do i have to use E in the middle of the statement?
2 What does E stand for?
Thanks!
With @{} you are creating a hash table. The N stands for Name and the E for Expression. So you could also write:
$vm | select Name, @{Name="IPAddress"; Expression={ $_ | Get-VMGuest | select -ExpandProperty IP*}}
Regards, Robert
With @{} you are creating a hash table. The N stands for Name and the E for Expression. So you could also write:
$vm | select Name, @{Name="IPAddress"; Expression={ $_ | Get-VMGuest | select -ExpandProperty IP*}}
Regards, Robert
3 minutes... Awesome 🙂
Thank you!
Hello, rock0n-
Robert has it right on for you.
There is some good info on this hash table and how it is used for "calculated properties" in the TechNet page at http://technet.microsoft.com/en-us/library/ff730948.aspx.
Also, getting full help on the Format-Table cmdlet talks about the other valid keys for a calculated property hash table (see the -Property portion), like Width and Alignment.
Hi mattboren,
that was the "dumb and outa vmware" example i was looking for 😉
thanks!