VMware Cloud Community
kwvalenti
Contributor
Contributor

Get-NicTeamingPolicy not working

When I attempt to use either of the following commands I get an error.  What am I missing?

Get-VirtualPortGroup -name PGNAME | Get-NicTeamingPolicy

Get-NicTeamingPolicy : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of

the parameters that take pipeline input.

At line:1 char:40

+ Get-VirtualPortGroup -name mm01-mgmt | Get-NicTeamingPolicy

+                                        ~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidArgument: (mm01-mgmt:PSObject) [Get-NicTeamingPolicy], ParameterBindingException

    + FullyQualifiedErrorId : InputObjectNotBound,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetNicTeamingPolicy

get-vmhost hostA | Get-VirtualSwitch -name dvSwitch01 | Get-NicTeamingPolicy

Get-NicTeamingPolicy : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of

the parameters that take pipeline input.

At line:1 char:78

+ get-vmhost hostA | Get-VirtualSwitch -name dvSwitch01 | Get ...

+                                                                              ~~~

    + CategoryInfo          : InvalidArgument: (mm01-vc01-dvSwitch01:PSObject) [Get-NicTeamingPolicy], ParameterBindingException

    + FullyQualifiedErrorId : InputObjectNotBound,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetNicTeamingPolicy

Thanks

0 Kudos
3 Replies
LucD
Leadership
Leadership

Try doing it as

$pg = Get-VirtualPortGroup -name PGNAME

Get-NicTeamingPolicy -VirtualPortgroup $pg

We have seen similar flaws in some cmdlets when retrieving, or better not retrieving, values from the pipeline.


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

0 Kudos
kwvalenti
Contributor
Contributor

No luck.

$pg = Get-VirtualPortGroup -name PGNAME

Get-NicTeamingPolicy -VirtualPortGroup $pg

Get-NicTeamingPolicy : Cannot bind parameter 'VirtualPortGroup'. Cannot convert the "PGNAME" value of type "VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.DistributedPortGroupImpl" to type

"VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualPortGroup".

At line:1 char:40

+ Get-NicTeamingPolicy -VirtualPortGroup $pg

+                                        ~~~

    + CategoryInfo          : InvalidArgument: (:) [Get-NicTeamingPolicy], ParameterBindingException

    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetNicTeamingPolicy

0 Kudos
LucD
Leadership
Leadership

Ah, but it seems that you are using a dvSwitch portgroup.

Afaik that is not yet supported in the cmdlet.


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

0 Kudos