You could do something like this.
But note that this a very limited copy of the settings of the portgroups.
The VLANId for example is not copied.
Currently it only does the LoadBalancing and Teaming order.
Also note that the script assumes the number of Uplinks on both VDS is the same and the standard Uplink naming was used.
This due to the Active and Standby settings being copied.
If need be, other portgroup properties could be copied as well.
$oldVds = 'dvSwitch01 '
$newVds = 'dvSwitch03'
$newVds = Get-VDSwitch -Name $newVds
Get-VDSwitch -Name $oldVds |
Get-VDPortgroup |
where{-not $_.IsUplink} |
ForEach-Object -Process {
$teaming = Get-VDUplinkTeamingPolicy -VDPortgroup $_
$sTeam = @{
LoadBalancingPolicy = $teaming.LoadBalancingPolicy
Confirm = $false
}
if($teaming.ActiveUplinkPort){
$sTeam.Add('ActiveUplinkPort',$teaming.ActiveUplinkPort)
}
if($teaming.StandbyUplinkPort){
$sTeam.Add('StandbyUplinkPort',$teaming.StandbyUplinkPort)
}
New-VDPortgroup -Name "$($_.Name)_dv03-portgroup" -VDSwitch $newVds -Confirm:$false |
Get-VDUplinkTeamingPolicy |
Set-VDUplinkTeamingPolicy @sTeam
}