| pid | 1088 |
|---|---|
| author | Cody Bunch |
| title | The PowerShell Talk 2 |
| date | 2009-05-10 07:48:32 -0700 |
| format | posh |
| parent | 0 |
The PowerShell Talk Demo 2 VMware - VM Easy Bake Oven
#The PowerShell Talk
#Demo 2 - VM Easy Bake Oven
#VMware
#Connect to vCenter
Get-Credential | connect-viserver -Server "Your vCenter Here"
#Create the new VM
get-vmhost -Name "ESX Server" | New-VM -Name Dave -DiskMB "10240" -GuestId "otherGuest" -MemoryMB 512 -NumCpu 1 -resourcepool "Demo"
#Get some info on said VM
get-resourcepool "Demo" | Get-VM | fl *
#Change the Memory
Get-VM -Name "Dave" | Set-VM -MemoryMB 1024 -confirm:$false
#And the Network
Get-VM -Name "Dave" | New-NetworkAdapter -NetworkName "Demo" -StartConnected:$true -confirm:$false
#Delete the VM
Get-VM -Name "Dave" | Remove-Vm -Confirm:$false