Assigning Disk Partition Space from .CSV file through PowerCLI Script
<p>I am trying to create a PowerCLI script that will create VM's based on settings that are taken from a CSV file. The CSV file is a result of a VBA script extracting data from an Excel spreadsheet that users will have entered their desired settings. What I have so far:</p>

<pre><code>$CSVPath = "C:\NewVMList.csv"  

$CSVFILE = Import-CSV $CSVPath  

$VMhost = Get-vmhost "$($CSVFile.VMHost)"  
$PortGroup = Get-VirtualPortgroup -name "$($CSVFile.VLAN)" -VMhost $VMhost  

New-VM -Name "$($CSVFile.Name)" -MemoryGB "$($CSVFile.MemoryGB)" -NumCPU "$($CSVFile.NumCPU)" -portgroup $Portgroup -DiskGB "$($CSVFile.C_System)"
</code></pre>

<p>The CSV file that it will be referencing for the values will have 3 cells that are available for the various partitions to be assigned space (C:\, D:\, M:(app data)). </p>

<p>What I would like to know is if there is a function that I can use within my PowerCLI script that can assign the various partitions the appropriate amount of space based on the CSV file or if this would need to be done manually? </p>

<p>Would it require something other than the <code>-DiskGB "$($CSVFile.C_System)"</code> to create partitions, as this seems to reference the overall disk space being allocated (I am probably wrong, please feel free to correct me)?   </p>