Hi, I have just started in powershell (completed my first script today http://teckinfo.blogspot.com/2008/06/my-first-powershell.html)
I was wondering if there was a command that would show me all properties of an item ? I often want to display information but am not sure of its property name.
Example... Get-VM | Select-Object -property "Name","PowerState","Description","NumCPU","MemoryMB"
Thanks
Get-Member is one of your best friends
Joking aside, have a look at Keith Hill's blog on Effective PowerShell
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Get-Member is one of your best friends
Joking aside, have a look at Keith Hill's blog on Effective PowerShell
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Aha I see, thanks...
get-vm | get-member -Membertype property
Also, try "get-foo | format-list *" sometime. You'll find that most times, many properties are not displayed by default. This shows them all.
Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Thanks guys, now to try and ammend my script in my first post to export information about each hosts CPU/Memory so that I can create a nice report in Excel and then draw pretty graphs!