virtual machine - Creating Hyper-V VMs with unique names using Powershell -


i'm trying make sort of script creates new vm, need told create unique vm name (with sort of logic, if possible, check existing names , using different automatically or telling me use else) . understand new vm made using unique guid default there no system conflicts, further need script go in , perform commands on vm, such starting vms, copying files onto it, etc. without unique name i'm not sure how script can automatically give commands right one.

for example, have:

new-vm testserver1 -asjob -generation 2 -memorystartupbytes 8192mb  -novhd -switchname vswitch-1 

but if vm named 'testserver1' exists, , have script automatically run:

start-vm testserver1 

both vms turn on...

edit:

also, know 1 can export results of creating new vm using 'out-file' don't know cleanest way format output read later.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -