VMware Cloud Community
garypaquette
Contributor
Contributor
Jump to solution

Get-VM get all baseline attributes and other objects

New to all of this - this is what I am trying to do with little success, seems like the the ' * ' work then the attribs after the comma does not provide the data nor is it part of the main payload, any help is appreciated:

Get-VM -Server $srv | Select *,
    @{N="Running OS";E={$_.Guest.OsFullName}},

    @{N="IP Address";E={@($_.guest.IPAddress -join '|')}}

    @{N="disktype";E={(Get-Harddisk $_).Storageformat}}

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You seem to have forgotten a common at the end of the 3th line.

I'm not sure what you have in $srv, but the following seems to work for when I place a Center to which I'm connected in $srv

Get-VM -Server $srv | Select *,

    @{N="Running OS";E={$_.Guest.OsFullName}},

    @{N="IP Address";E={@($_.guest.IPAddress -join '|')}},

    @{N="disktype";E={(Get-Harddisk $_).Storageformat}}


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

View solution in original post

2 Replies
LucD
Leadership
Leadership
Jump to solution

You seem to have forgotten a common at the end of the 3th line.

I'm not sure what you have in $srv, but the following seems to work for when I place a Center to which I'm connected in $srv

Get-VM -Server $srv | Select *,

    @{N="Running OS";E={$_.Guest.OsFullName}},

    @{N="IP Address";E={@($_.guest.IPAddress -join '|')}},

    @{N="disktype";E={(Get-Harddisk $_).Storageformat}}


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

garypaquette
Contributor
Contributor
Jump to solution

Ok - now I just feel stupid 🙂

Thanks for the catch!

Gary

0 Kudos