Hi,
I see several examples of this, but I am struggling with the correct syntax to do the following:
I can use the following to do a simple clone:
New-VM -Name VM2 -VM VM1 -Datastore datastorename -vmhost hostname -DiskStorageFormat thin
but want to further automate the other pieces.
Any insight is appreicated!
If your text file is setup as a CSV file, you can do something like this
Import-Csv C:\text.csv -UseCulture | %{
New-VM -Name ($_.Name + "-clone") -VM $_.Name -Datastore datastorename -vmhost hostname -DiskStorageFormat thin
}
This assumes your CSV file looks something like this
Name
VM1
VM2
VM3
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
If your text file is setup as a CSV file, you can do something like this
Import-Csv C:\text.csv -UseCulture | %{
New-VM -Name ($_.Name + "-clone") -VM $_.Name -Datastore datastorename -vmhost hostname -DiskStorageFormat thin
}
This assumes your CSV file looks something like this
Name
VM1
VM2
VM3
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Luc, as always, Thank You..
+ "-clone" this is what I couldn't seem to get correct..
Cheers!