VMware Cloud Community
JamesZmrrr1_
Contributor
Contributor

variable and parameter of OS types PowerCLI

Hello,

I was asked to create a script PowerCLI that allows the user to create a new VM then to choose the name of the VM as well as its storage volume, its memory volume and especially its type of OS.
And this is where I block I do not know what to put as a variable and as a parameter

below my script :

 

$NameVM = Read-Host 'Name of the VM'
>> $VolumeStockage = Read-Host 'How much storage ?'
>> $VolumeMemoire = Read-Host 'How much mémory ?'
>> New-VM -Name $NameVM -DiskGB $VolumeStockage -DataStore datastore1 -MemoryGB $VolumeMemoire ???-guestidtype linux???

 

Ps : I do that with ESXI 6.0

Labels (5)
0 Kudos
1 Reply
LucD
Leadership
Leadership

The GuestId parameter takes any value from the VirtualMachineGuestOsIdentifier enumeration.
You can obtain the available values in your vSphere version with

([VMware.Vim.VirtualMachineGuestOsIdentifier]).GetEnumNames()

 


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference