Hi everyone !
I would like to deploy many VM from a .csv file. I know it is pretty basic but I don't get it to work... What did I do wrong ?
Here is my scrypt :
Here my .csv file :
The result is :
name;host;datastore;disk;memory;cpu
-----------------------------------
vm1;h1e0mudag-a.dc.infra.com;h1e0mudag-local-storage;200;512;1
vm2;h1e0mudag-a.dc.infra.com;h1e0mudag-local-storage;300;513;2
New-VM : Impossible de valider l'argument sur le paramètre « Name ». L'argument est null ou vide.
Because I'm French, the message is in French but for those who don't understand French, it basicaly means :
Impossible to validate the argument in the parameter "Name". The argument is Null or empty.
I don't understand... I can select lines of my csv file but can't get the colomns... Is New-VM –Name $line.name not right ?
Thanks for your answers.
Pozitim
Try changing the line
$list = Import-CSV C:\config1_new_vm.csv
into
$list = Import-CSV C:\config1_new_vm.csv -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try changing the line
$list = Import-CSV C:\config1_new_vm.csv
into
$list = Import-CSV C:\config1_new_vm.csv -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks so much, it's working ! Quick, clear and right answer !