Avatar of Kelly Garcia
Kelly Garcia
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

New VM using PowerCli

Hi guys,

I've written this powercli script to create new VM's in my environment:

$dsc=Get-Datastore "asdasd"
$tmp=Get-Template -name *win*2008*r2*ent
$name="???"

New-VM -Name "$name" -Template $tmp -Datastore $dsc -Memorygb 4 -NumCPU 2 -Networkname DB_SQL_2264 -Notes "x" -DiskGB 40,50,50,100

Open in new window


Question is, is there a way I can pop up form on the $dsc, $tmp, $name variables and populate them accordingly, e.g $dsc will pop up all the datastore and allows you to select one.

 I need to set an static ip adreesses along with DNS information how can I do this?

Also I need to select an ISO image on the CD rom.

Thank you in advance.

Regards,
kay
PowershellScripting LanguagesShell ScriptingMicrosoft Server OSServer Hardware

Avatar of undefined
Last Comment
compdigit44

8/22/2022 - Mon