Add-PSSnapin vmware.vimautomation.core
$vc=" vcname "
Connect-viserver $vc
$vminfo=get-content " C:\vmname.csv "
foreach ($vm in $vminfo){
New-HardDisk -vm $vm -CapacityGB 2 -StorageFormat:EagerZeroedThick -Confirm:$false
New-HardDisk -vm $vm -CapacityGB 1 -Confirm:$false
}
$vc=" vcname "
Connect-viserver $vc
$vminfo=get-content " C:\vmname.csv "
foreach ($vm in $vminfo){
New-HardDisk -vm $vm -CapacityGB 2 -StorageFormat:EagerZeroedThick -Confirm:$false
New-HardDisk -vm $vm -CapacityGB 1 -Confirm:$false
}
Disconnect-VIServer -Confirm:$false
本文转自学海无涯博客51CTO博客,原文链接http://blog.51cto.com/549687/2044991如需转载请自行联系原作者
520feng2007