VMware Cloud Community
VirtualKenneth
Virtuoso
Virtuoso
Jump to solution

Beginners question about "get-vm"

Hi,

I've got a beginners question since I just dived into the PowerCli world Smiley Happy

Whenever I give a "get-vm -name " I get a result that displays me the: Name, PowerState, Num CPU and memory.

No I've created a very simple script:

param ( $VMHost, $VMName )

Connect-VIServer $VMHost

Get-VM -name $VMName

Whenever this is executed: ./script.ps1 it gives me far more information about that specific VM.

Am I overlooking something since IMHO the "get-vm" sentences are identical.

Thanks for clearing this out to me!

Kenneth

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

That's caused by the PS1XML file in the PowerCLI directory, called VMware.VimAutomation.Format.ps1xml.

This XML file contains the definitions how specific objects are displayed on the console.

When you execute the script other formatting rules come into play.

Rest assured the data is there.

You can add a Select-Object or Format-List cmdlet to see all the available properties.

Something like this

Get-Vm -Name <name> | Select *

or

Get-Vm -Name <name> | fl


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

That's caused by the PS1XML file in the PowerCLI directory, called VMware.VimAutomation.Format.ps1xml.

This XML file contains the definitions how specific objects are displayed on the console.

When you execute the script other formatting rules come into play.

Rest assured the data is there.

You can add a Select-Object or Format-List cmdlet to see all the available properties.

Something like this

Get-Vm -Name <name> | Select *

or

Get-Vm -Name <name> | fl


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
VirtualKenneth
Virtuoso
Virtuoso
Jump to solution

Aaah... yeah I was aware of the select-object command but found it strange that the output varied.

Thanks for making me feel "the real beginner" Smiley Happy haha!

Thanks!

0 Kudos