VMware Cloud Community
jvm2016
Hot Shot
Hot Shot

intellisense _powercli

Hi Luc,

Get-VMHostNetworkAdapter -VMHost $esxi -VMKernel|?{$_.

while typing above i was expecting ManagementTrafficEnabled as one of the listed properties but i did not find that .not sure if its a bug or someother thing but it is not the exptected

response .i need to write manually ...colud you suggest something on this

Get-VMHostNetworkAdapter -VMHost $esxi -VMKernel|?{$_.ManagementTrafficEnabled -eq "true"}

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership

I'm afraid that is working as designed.

The Get-VMHostNetworkAdapter cmdlet is written to return a HostVirtualNic object (see the Output section when you do Get-Help -Name Get-VMHostNetworkAdapter -Full).

In this case, Intellisense uses that Output object to determine which properties are present.

Unfortunately, the ManagementTrafficEnabled property is not present on the HostVirtualNic object.

That property and others are present on two types (HostVMKernelVirtualNic, HostConsoleVirtualNic) that extend the HostVirtualNic object.

But Intellisense doesn't know about that, it only uses the type of object defined on Output.


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

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot

right now i a able to find that property to get the desired output .i am working on the logic to extend the previous script.

thanks for your support .

Reply
0 Kudos