You can not use the -Template and -Networkname parameters of the New-VM cmdlet in one command, because both parameters are in different parameter sets. You should create the VM first and then use the Set-NetworkAdapter cmdlet to change the portgroup of the VM. Like in example 4 of the Set-NetworkAdapter cmdlet help:
-------------- Example 4 --------------
C:\PS>$myNetworkAdapters = Get-VM | Get-NetworkAdapter -Name "Network adapter 1"
$myVDPortGroup = Get-VDPortgroup -Name MyVDPortGroup
Set-NetworkAdapter -NetworkAdapter $myNetworkAdapters -Portgroup $myVDPortGroup
Retrieves all network adapters named "Network adapter 1" from all virtual machines and connects them to the specified distributed port group.