Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 258290

Re: How to find a correct datastore of a VM and add a new disk of size 10GB to list of VMs that saved in a ".txt" file?

$
0
0

You mean something like this?

 

$vmlist=Get-Content C:\vm.txt

 

foreach($vminGet-VM-Name $vmlist){

   $hd=Get-HardDisk-VM $vm| select -First 1

   $dsName=$hd.Filename.Split('/')[0].TrimStart('[')

   New-HardDisk-VM $vm-CapacityGB 10-Datastore $dsName-storageFormat $hd.StorageFormat

}


Viewing all articles
Browse latest Browse all 258290

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>