Hyper-V common commands

  
                  Powershell's Hyper-V modules and documentation can be downloaded at: http://pshyperv.codeplex.com/releases/view/38769 Detailed command descriptions are in the documentation called PSHyperv-R2.pdf. You cannot use the powershell command to manage Hyper-V without the powershell module installed. 1.Start-VM virtual machine boot Start-VM -VM virtual machine name -Server server name -Wait -Force-VM Specifies the virtual machine to be started Name-Server Specifies the physical server where the virtual machine is located. If left blank, the default is ".", which is the machine. -Wait Specifies to wait for the task to complete before running the following command. Generally, it is used in continuous operation. The Force virtual machine does not pop up when it is powered on. Therefore, this parameter does not seem to have any effect on Start-VM. For parameter values, the preceding parameter names such as "-VM", "-Server" can be omitted. Example: Start-VM testvps Start test for testvps Start-VM testvps -Wait ; Stop-VM testvps -Force Start testvps first and then testvps shutdown. Here you must use -Wait or the second command will report an error, the result is only open 2 .Stop-VM virtual machine (equivalent to pressing the server shutdown button directly) Stop-VM -VM virtual machine name -Server server name -Wait -Force-Force virtual machine, the option will be further popped "Do you really want to execute this? Operation?". After adding this parameter, there will be no prompt, directly select the default value [Y] and the rest of the parameters are similar to Start-VM. Example: Stop-VM testvps Shutdown to testvps, after the operation will pop up a prompt, press Y to continue Stop-VM testvps -Force directly to testvps shutdown, no pop-up prompt Start-VM testvps -Wait -Force; Stop-VM testvps first testvps Shut down and then power testvps, you must use -Wait, otherwise the second command will report an error, the result can only be closed Get-VM -Running
Copyright © Windows knowledge All Rights Reserved