Thanks again LucD
Two additional questions if you don't mind.
1) Get-VM -name $vm | Select Name, @{N="IP Address";E={@($_.guest.IPAddress[0])}}
How can I use that IP so i can create an IF on my code later to decide what portgroup to use to add the extra nic? So if my ip is on the 10.0.10.0 subnet use pg1, if at 10.10.10.0 use pg2 and so on.
2) What's in your opinion the best way to add the creation data on a file, so they can be used "as is" to have a roll back script? e.g. Remove-NetworkAdapter to remove just the one that was added.
This is what I currently have: New-NetworkAdapter -VM $vm -NetworkName $portgroup -Type Vmxnet3 -StartConnected | Select @{N='VM';E={$_.Parent.Name}},Name,MacAddress,Id
As always, appreciate the help.