Just checked again, and there seems to be indeed a problem with the DiskLimitIOPerSecond parameter
Try it like this
$vmName="MyVM"
$DiskLimitIOPerSecond=50
# $DiskLimitIOPerSecond = -1 # Unlimited$vm=Get-VM-Name$vmName$spec=New-ObjectVMware.Vim.VirtualMachineConfigSpec$vm.ExtensionData.Config.Hardware.Device|
where {$_-is [VMware.Vim.VirtualDisk]} |%{ $dev=New-ObjectVMware.Vim.VirtualDeviceConfigSpec
$dev.Operation="edit"
$dev.Device=$_
$dev.Device.StorageIOAllocation.Limit=$DiskLimitIOPerSecond
$spec.DeviceChange+=$dev
}$vm.ExtensionData.ReconfigVM_Task($spec)
Note: to set the limit back to unlimited, you have to give the value -1