VMware Cloud Community
bspmadmin
Contributor
Contributor
Jump to solution

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

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

0 Kudos
1 Solution

Accepted Solutions
halr9000
Commander
Commander
Jump to solution

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 . The first line below is a workaround for a documented bug which is also mentioned here: .

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)

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000

View solution in original post

0 Kudos
2 Replies
halr9000
Commander
Commander
Jump to solution

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 . The first line below is a workaround for a documented bug which is also mentioned here: .

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)

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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.


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