2 Replies Latest reply on May 19, 2008 10:55 AM by LucD

    How do I get a list of available properties for an object?

    bspmadmin Lurker

      I want to get a list of the available properties for an object...specifically VMware.Vim.HostPortgroupSpec.   How do I do this?

        • 1. Re: How do I get a list of available properties for an object?
          halr9000 Master
          bspmadmin wrote:

          I want to get a list of the available properties for an object...specifically VMware.Vim.HostPortgroupSpec.   How do I do this?

           

          You create an instance of the object, then use the Get-Member cmdlet on it.  There is mention of this in the  Managing VMware with PowerShell FAQ.  The first line below is a workaround for a documented bug which is also mentioned here: Problem with "New-Object VMware.Vim.ManagedObjectReference".

           

          36# $vmhost = Find-EntityView -ViewType "hostsystem"
          37# $pgspec = New-Object VMware.Vim.HostPortgroupSpec
          38# $pgspec | gm
          
          
             TypeName: VMware.Vim.HostPortGroupSpec
          
          Name            MemberType Definition
          ----            ---------- ----------
          Equals          Method     System.Boolean Equals(Object obj)
          GetHashCode     Method     System.Int32 GetHashCode()
          GetType         Method     System.Type GetType()
          ToString        Method     System.String ToString()
          DynamicProperty Property   VMware.Vim.DynamicProperty[] DynamicProperty {ge...
          DynamicType     Property   System.String DynamicType {get;set;}
          Name            Property   System.String Name {get;set;}
          Policy          Property   VMware.Vim.HostNetworkPolicy Policy {get;set;}
          VlanId          Property   System.Int32 VlanId {get;set;}
          VswitchName     Property   System.String VswitchName {get;set;}

           

           

          Hal Rottenberg

          Co-Host, PowerScripting Podcast (http://powerscripting.net)

          • 2. Re: How do I get a list of available properties for an object?
            LucD Guru
            vExpertUser ModeratorsCommunity Warriors

            If you want more information on what each property means you can have a look at the SDK API Reference Documentation.

            In this case more specifically at the HostPortGroupSpec entry.

            1 person found this helpful