You have to use the VirtualNic parameter instead of the PhysicalNic parameter.
Those 2 lines should be
$uplinkportgroup = Get-VDPortgroup -name phys-10g -VDSwitch $VDSwitch
Set-VMHostNetworkAdapter -PortGroup $uplinkportgroup -VirtualNic $vmhostadapter