2012年11月21日 星期三

Hyper-V PowerShell Create/Start/Suspend/Stop VM

記得要有足夠的權限才能執行

Create VM

 

New-VM -Name "WinServer2008R2" -MemoryStartupBytes 2GB -BootDevice "CD" -NewVHDPath "d:\vm\WinServer2008R2.vhdx" -NewVHDSize (2048 * 1000 * 10) -SwitchName "虛擬交換器" 

Start/Suspend/Stop VM

runas /user:administrator "powershell Suspend-VM -Name ""Win7x86"""  
runas /user:administrator "powershell Start-VM -Name ""Win7x86""" 
runas /user:administrator "powershell Stop-VM -Name ""Win7x86""" 

沒有留言:

張貼留言