Few Handy VMware Powershell commandlines

Add a HDD to a virtual machine:

$VM=’name of the VM’
$size=’Size in GB, Numeric only’
$Datastore=’Name of the Datastore’
$ProvisionType=”Thin/Thick/EagerZeroedThick”)
$Controller=’SCSI Controller 0′

New-HardDisk -VM $VM -CapacityGB $size -Datastore $Datastore -StorageFormat $ProvisionType -Controller $Controller $DiskType

 

Clone VM

$Name=’Name of the new VM’
$source=Name of the Source virtual machine’
$Datastore=’Datastore name’
$host=’host name or IP’
$DiskType=’thin/thick’

New-vm -name $Name -vm $source -datastore $Datastore -vmhost $host –DiskStorageFormat $DiskType

Related Posts
%d bloggers like this: