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

Re: Script to set the CPU and Memory for VMs

$
0
0

you could do this with the column headers being:

 

VMName,CPU,MEM

 

$vmlist = Import-CSV C:\csvfile.csv

 

foreach ($item in $vmlist) {

    $vmname = $item.vmname

    $cpu = $item.cpu

    $mem = [int]$item.mem * 1024

    Set-VM -VM $vmname -NumCpu $cpu -MemoryMB $mem -RunAsync -Confirm:$false

}


Viewing all articles
Browse latest Browse all 144140

Trending Articles