This is probably a very noob powershell question, but here goes.
I want to select only a few properties for display when using a particular cmdlet, but when I club them using the select statement, only the first one in the select statement is shown.
E.g., the cmdlet I'm interested in is Get-VM
When I execute Get-VM on its own, I get a few default fields:
Name State CPUUsage(%) MemoryAssigned(M) Uptime Status
---- ----- ----------- ----------------- ------ ------
everything OffCritical 0 0 00:00:00 Cannot connect to virtual machine configuration storage
SCOrch Running 0 1393 1.05:02:16 Operating normally
Server 2012 Base Image Off 0 0 00:00:00 Operating normally
Server 2012 DC Off 0 0 00:00:00 Operating normally
Now, say I want to just display Name and State. I tried Get-VM | select Name,State
I only get the Name column returned
Name
----
everything
SCOrch
Server 2012 Base Image
Server 2012 DC
I only get the first argument passed to the select statement returned, it simply ignores the other ones. How can I return only the columns I want?
Thanks in advance

