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
I would suspect issue with size of buffer/ window. If buffer is wider than buffer than some columns may become "invisible". State, as an [enum]
(read: [int]
in disguise) will be always right-aligned by default. Name ([string]
) will be aligned left. Suspect you would see everything by simply changing order.
Take a look at this screenshots:
This is same command, I just changed width of the window to match width of my buffer... Looks familiar?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With