Using Hyper-V PowerShell

Source: Internet
Author: User

I. List of hyper-V PowerShell command-line modules

In the search for PowerShell and open PowerShell

Get-command–module Hyper-V | Out-gridview

Use Get-help to help you learn hyper-V PowerShell

650) this.width=650; "height=" 141 "title=" clip_image004 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image004 "src=" http://s3.51cto.com/wyfs02/ M01/77/d1/wkiom1zuun7swg1gaaciryzkvqs652.jpg "border=" 0 "/>

Ii. using PowerShell to list virtual machines

Use the following command to list the virtual machines that are running

GET-VM | where {$_. State–eq ' Running '}

Use the following command to list the virtual machines that have been shut down

GET-VM | where {$_. State–eq ' Off '}

Iii. creating a virtual machine using PowerShell

Open windows PowerShell ISE with an administrator

Use the following command to create a virtual machine

$VMName = "Client01" $VM = @{Name = $VMName Memorystartupbytes = 2147483648 Generation = 2 Newvhdpath = "d:\h Yper-v\ $VMName \ $VMName. vhdx "newvhdsizebytes = 53687091200 BootDevice =" VHD "Path =" D:\Hyper-V\ $VMName "Sw Itchname = (get-vmswitch). NAME[0]}NEW-VM @VM

650) this.width=650; "height=" 803 "title=" clip_image009 "style=" border:0px;padding-top:0px;padding-right:0px; Padding-left:0px;background-image:none, "alt=" clip_image009 "src=" http://s3.51cto.com/wyfs02/M02/77/D0/ Wkiol1zuupcr_vcwaak3wrysbca463.png "border=" 0 "/>

For more information on the Hyper-V PowerShell cmdlet section, see Microsoft Official website:

Https://technet.microsoft.com/%5Clibrary/Hh848559.aspx

This article is from "Xu Ting blog-it technology sharing" blog, please be sure to keep this source http://ericxuting.blog.51cto.com/8995534/1722991

Using Hyper-V PowerShell

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.