LucD,
csv looks good. i tried replace the this code
if($item.ahdd -gt 0){
$VM | New-HardDisk -CapacityGB $item.ahdd -Confirm:$false
}
to
$VM | New-HardDisk -CapacityGB $item.ahdd -Confirm:$false
Now I am getting this error
New-HardDisk : Cannot validate argument on parameter 'CapacityGB'. The argument is null. Provide a valid value for the argument, and then try running the command again.
At D:\deploy_Template\vmdeploy.ps1:27 char:32
+ $VM | New-HardDisk -CapacityGB $item.ahdd -Confirm:$false
+ ~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [New-HardDisk], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk