I want to get a list of the available properties for an object...specifically VMware.Vim.HostPortgroupSpec. How do I do this?
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)
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)
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