For the host you have to specify the FQDN. Something like ESX1.yourdomain.com.
You can try:
$VMHost = Get-VMHost -Name ESX1.yourdomain.com
New-VM -name clone1 -Datastore datastore1 -VM <sourcevm name> -VMHost $VMHost
For the host you have to specify the FQDN. Something like ESX1.yourdomain.com.
You can try:
$VMHost = Get-VMHost -Name ESX1.yourdomain.com
New-VM -name clone1 -Datastore datastore1 -VM <sourcevm name> -VMHost $VMHost