I am also getting a similar error when i try to change a value.
$portgroup =(Get-VirtualPortGroup -Name MX_LAB_153)
(Get-virtualportgroup -name $portgroup).extensiondata.config.defaultportconfig.uplinkteamingpolicy.policy.value
output:loadbalance_loadbased
i got the below error when i ran this command to cahnge the policy to source id
(Set-virtualportgroup -name $portgroup).extensiondata.config.defaultportconfig.uplinkteamingpolicy.policy.value="loadbalance_srcid"
Error:
Set-VirtualPortGroup : Cannot bind parameter 'VirtualPortGroup'. Cannot convert the "mx_lab-153" value of type "System.String" to type "VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualPortGroup".
At C:\test.ps1:2 char:22
+ (Set-virtualportgroup <<<< -name $portgroup).extensiondata.config.defaultportconfig.uplinkteamingpolicy.policy.value='loadbalance_srcid'
+ CategoryInfo : InvalidArgument: (:) [Set-VirtualPortGroup], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,VMware.VimAutomation.ViCore.Cmdlets.Commands.SetVirtualPortGroup
how do i set the teamingpolicy to loadbalance_srcid using powershell on one/all dvportgroups?
looks like set-nicteamingpolicy/get-nicteamingpolicy only works with standard switch. any help is much appreciated.