Reputation: 559
Running:
get-vm -server hyperv
get-vm -server hyperv | format-table -AutoSize
Result in a 5 column output with data in all 5 columns as expected.
Running:
get-vm -server hyperv | select VMElementName,State,Host | format-table -AutoSize
get-vm -server hyperv | format-table -Property VMElementName,State,Host -AutoSize
Results in a 3 column output with data in only the VMElementName column. Any attempt to reduce the number of columns results in all but the VMElementName column is empty. Changing order has no effect. Selecting any single column makes no difference. Only the VMElementName column contains data.
How do I get the rest of the data to be shown?
Upvotes: 2
Views: 3217
Reputation: 1168
Using the Hyper-V module from Server 2008 R2, Get-VM returns objects of the type System.Management.ManagementObject#root\virtualization\Msvm_ComputerSystem
. In other words, these are WMI based objects, where the WMI class is Msvm_ComputerSystem
.
Your issue is that this object does not contain some of the properties you are asking for.
If you do a Get-VM | Get-Member
, you can see the actual properties available, I think what you want is
Get-VM | FT Elementname, statusdescriptions,pscomputername
Elementname statusdescriptions PSComputerName
----------- ------------------ --------------
Lync - SE {Operating normally} COOKHAM8
Lync - QMS {Operating normally} COOKHAM8
Lync - DC {Operating normally} COOKHAM8
Lync - SPS2010 {Operating normally} COOKHAM8
DEV1 - win7+Dev tools {Operating normally} COOKHAM8
S1.Cookham/Net (Srv2012) {Operating normally} COOKHAM8
SQL2012 {Operating normally} COOKHAM8
W8.Cookham.Net(w8 RTM) {Operating normally} COOKHAM8
Lync - EXUM {Operating normally} COOKHAM8
SQL2008 {Operating normally} COOKHAM8
Upvotes: 3
Reputation: 201652
Empty Format-Table
columns usually indicate that the associated property doesn't exist or the value for each item is $null or an empty string. If I look at the output of Get-VM on Windows 8 (where I have one hyper-v VM created), I don't see those properties. You can see what properties are available using Get-Member
like so:
Get-VM -server hyperv | Get-Member
Upvotes: 1