VMware Cloud Community
axm3196
Contributor
Contributor
Jump to solution

Vmware.Hv.Helper Format-Custom

Running Get-HVPool | Format-Custom I can see all the data i want to pull from our envrionment, but i'm unfamilar with the output format

class DesktopInfo

{

  Base = 

    class DesktopBase

    {

      Name = CIFS_Test

      DisplayName = CIFS_Test

      AccessGroup = VMware.Hv.AccessGroupId

      Description = 

    }

}

 

What is this format? Can i redirect this back into a Var like XML or JSON? Or if possible can i convter this output into a more popular format?

class DesktopInfo
{
  Base = 
    class DesktopBase
    {
      Name = CIFS_Test
      DisplayName = CIFS_Test
      AccessGroup = VMware.Hv.AccessGroupId
      Description = 
    }
}
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

The Format-Custom cmdlet is one way of displaying the content (properties) of an object.

The view is hierarchical and not in a flat list.

Unfortunately you can't "feed" the output into another cmdlet.

You will probably have better luck with the Select-Object cmdlet.

Get-HVPool |

Select Source,Type,@{N='BaseName';E={$_.Base.Name}}

There you can specify on the Property parameter which properties shall be shown.

To find the available properties in an object, you can pipe the object to the Get-Member cmdlet.

Get-HVPool | Get-Member


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

View solution in original post

0 Kudos
1 Reply
LucD
Leadership
Leadership
Jump to solution

The Format-Custom cmdlet is one way of displaying the content (properties) of an object.

The view is hierarchical and not in a flat list.

Unfortunately you can't "feed" the output into another cmdlet.

You will probably have better luck with the Select-Object cmdlet.

Get-HVPool |

Select Source,Type,@{N='BaseName';E={$_.Base.Name}}

There you can specify on the Property parameter which properties shall be shown.

To find the available properties in an object, you can pipe the object to the Get-Member cmdlet.

Get-HVPool | Get-Member


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

0 Kudos