PowerShell v3 in Hyper-V 3.0: new fun for command line users

Source: Internet
Author: User

With the upcoming release of Hyper-V 3.0 and Windows Server 8, Microsoft further clarified that PowerShell v3 will become the underlying management standard for its Server platform. The latest PowerShell v3 contains a large number of brand-new cmdlets for managing and automating servers and Windows 8 desktops, including Hyper-V with over 1000 cmdlets.

In the past few years, Microsoft has added the PowerShell script language code to build a management system for many products. The most famous one is Exchange 2010. The coming PowerShell v3 will serve as the basic component for Hyper-V management tasks and commands. According to Microsoft internal staff, all Microsoft graphical interface management tools will use PowerShell as the underlying command execution. For example, you can manage Windows Server role, such as Hyper-V, by running the Systems Center management tools of PowerShell cmdlets at the underlying layer. In the near future, you will use the command line of PowerShell v3 to complete Hyper-V installation and configuration, without the need for a GUI. Hyper-V 3.0 PowerShell v3 first downloads the Windows Server 8 Beta code from MSDN or TechNet. Then, install the VM on the selected hypervisor. My Hyper-V 3.0 testing environment I widely use VMware Workstation and Fusion, and installing the test code above is simple. The latest VMware Workstation 8 or even Windows Server 8 is pre-installed with the machine type, which is listed in the test list. You can also download a custom. vhd image to the Windows Server 8 virtual disk. Then load it to the existing Hyper-V server. After Windows Server 8 is installed, run the following PowerShell command to start the installation of the Hyper-V Role: Add-WindowsFeature Hyper-V-Restart (although "feature" is used in the command ", but it is actually a Role. Then, load the Hyper-V PowerShell Module: Import-Module Hyper-V and run PowerShell v3 cmdlets in Hyper-V 3.0. Obtain the list of all the cmdlets that can manage Hyper-V: Get-Command-Module Hyper-V-Verb after loading the new Module to PowerShell, I like to use the following command to list all the relevant properties of a specific object: Get-VM | Get-Member-MemberType Property is very interesting to show, right? Now you can see all the attributes, new and old -- such as virtual disk, memory allocation, processor count, etc. Now you can query through various Powershell cmdlets. Below are some interesting new commands I have found. Please explore more commands on your own: enable-VMMigration # enable migrations the cmdlets enables the migration function of virtual machines between Hyper-V hosts Add-VMMigrationNetwork # add subnets to the VM migration settings by executing the cmdlets, you can add subnets to the Hyper-V migration network. In this way, the settings of the host that supports migration are more flexible. New-VMReplicationAuthorizationEntry # add authorization entry for a VM this cmdlets creates a New authentication entry, including a New Hyper-V host machine or an authorized master server ), including the secondary storage corresponding to the Hyper-V cluster. Disadvantages of PowerShell v3 when you get a new set of Hyper-V cmdlets in PowerShell, you also need to understand its disadvantages. The new Hyper-V 3.0 cmdlets cannot manage earlier versions of Hyper-V. This is a very serious problem, which means that the Administrator must use different scripts to manage different Hyper-V hosts until all the hosts are upgraded. Incompatibility between Hyper-V 3.0 and earlier versions is difficult to understand and cause inconvenience. However, we know that this is not uncommon for software vendors. For administrators who use earlier Hyper-V versions, you need to download PowerShell Library for Hyper-V from CodePlex.

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.