1 Reply Latest reply on Apr 16, 2018 9:45 AM by LucD

    Vmware.Hv.Helper Format-Custom

    axm3196 Lurker

      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 = 
          }
      }
        • 1. Re: Vmware.Hv.Helper Format-Custom
          LucD Guru
          Community WarriorsUser ModeratorsvExpert

          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