Run PowerShell scripts to simplify Windows virtualization tasks

Source: Internet
Author: User

The new version of PowerShell comes with Windows Server 2012 R2. Now, the only way to use PowerShell 4.0 is to get and use Windows Management Framework 4.0.

PowerShell can be used to maximize the help and usage of Windows virtualization tasks. Now I have a database on the Internet for this topic. The most popular is a five-part series of articles from the TechNet blog. With this information, you can find a lot of details about PowerShell script automated multi-virtualization settings, configuration, and maintenance tasks.

The TechNet articles provide basic knowledge about running PowerShell scripts.

The content in the TechNet series provides a good overview of the role of PowerShell In the virtualization world. This series also provides an overview of the graphic PowerShell interface, provides scripts for ing workflow IDs to VMS, and introduces how to create scripts when using PowerShell WMI to create virtual hard disk VHD, how to obtain the IP address of a Hyper-V virtual machine, how to disable the client Virtual Machine in Hyper-V, and how to create a complete virtual network in Hyper-V.

With enough time and enthusiasm, you can use PowerShell to do many things. Of course, the real benefit is that you can automate repetitive tasks. The higher the task repetition, the higher the utilization.

CodePlex provides Hyper-V scripts

Vswitches in Windows Server 2012 and Windows Server 2012 R2 are easier to use than earlier versions. Vswitch extension also means you can use updates and enhancements without wasting effort on repetitive work.

The CodePlex PowerShell Management Library provides the best materials. You can use more than 100 cmdlets to find and connect to the VM, observe and operate the machine status, back up or exit the VM, and process VHD files.

Hyper-V has its own set of cmdlet

Figure 1. Hyper-V PowerShell script

Hyper-V 3.0 and 150 PowerShell cmdlets. You can use PowerShell to display available resources and how to run and use these scripts. In a normal PowerShell running environment, enter the following Command: Get-Command-Module Hyper-V figure 1 ).

Append-Name * search * to the command to obtain other details about the cmdlet. * Is a wildcard. you can replace it with the string you want to search for, such as add and find. The Get-Help cmdlet can be followed by three output types:-Examples code instance),-Detailed output), and-Full ). Therefore, Get-Help Add_VMNetworkAdapter-Examples displays a PowerShell script instance that adds a network adapter to a VM.

When using PowerShell to access the Hyper-V module, You need to enable this function in advance and enter the following command:

 
 
  1. Add-WindowsFeature Hyper-V -IncludeManagementTools 

As an administrator, you must also run the PowerShell console to interact with and manage Hyper-V, so be sure to follow these simple steps as soon as possible.

Related Article

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.