Comment

adding block devices to the vm.

-------------- Example 1 --------------

$vm = Get-VM VM

$vm | New-HardDisk -CapacityKB 10000 -Persistence persistent

Adds to the VM virtual machine a new hard disk in a persistent mode with capacity of 1000 KB.

-------------- Example 2 --------------

$deviceName = ($host | Get-ScsiLun | Where {$_.CanonicalName -match "naa"})[0].ConsoleDeviceName

New-HardDisk -VM $vm -DiskType RawPhysical -DeviceName $deviceName

Obtains a valid device name for Raw Disk Mapping. Then the command creates a RDM hard disk for the specified virtual machine, with the obtained device name.

Remove block device from the VM

remove-harddisk

To add datastore

add-datastore

To remove datastore

remove-datastore

Please refer to http://www.vmware.com/support/developer/windowstoolkit/wintk40u1/html/index.html