PowerShell 3.0 Management Hyper-V 3.0_powershell

Source: Internet
Author: User
Tags powergui

Managing Hyper-V 3.0 with PowerShell 3.0

PowerShell Ise is a PowerShell integrated development environment integrated into Windows Server, in Windows Server 8, PowerShell Ise is finally starting to support IntelliSense:

Although not as PowerGUI Script editor also used, but has been very good, and support Plug-ins, the current plug-in is not much, on the teachnet can be viewed.

PowerGUI Script Editor does not support PowerShell 3.0 for the time being, so it will be developed using PowerShell ISE.

A useful feature of the new version of PowerShell Ise is the ability to view, search for modules and commands:

Using the Hyper-V module below, you can see many commands:

The VHD virtual disk format, which has appeared as early as the VIRTUALPC era, is the standard format for Microsoft Virtual Storage, which supports booting directly from a VHD virtual disk in Windows 7 and Windows Server 2008 R2, but the maximum capacity limit is 2TB.

To Hyper-V 3.0, the capacity limit has been upgraded to 16TB and updated to VHDX the disk format.

1. Create a Virtual disk

New-vhd-path "F:\WORK\TMP\HYPER-V\TEST.VHDX"-VHDTYPEDYNAMIC-VHDFORMATVHDX-SIZEBYTES1024MB

As shown in the following illustration, a virtual disk in a VHDX format is created in the F:\Work\tmp\Hyper-V directory, with a capacity of 1GB, dynamically expanding.

In Windows Server 8, you can mount the VHDX virtual disk format directly:

You can initialize it in Disk Manager:

An MBR partition table is generally used and is formatted as NTFS and can be viewed in Explorer, which is no different from a physical hard disk:

2. View Existing virtual machines

Get-vm-name "WINSERVER2003R2"

Script Run Result:

3, view the Hyper-V server information

Get-vmhost

4. Create a virtual machine

New-vm-name "winserver2008r2"-memorystartupbytes2gb-bootdevice "CDRom"-newvhdpath "F:\Backup\Developer\" Virtualization\virtual machines\hyper-v\virtual Hard disks\winserver2008r2.vhdx "-newvhdsize (2048*1000*10)- Switchname "Hyper-V Switch"

5, start, shut down the virtual machine

Start-vm-name "WINSERVER2008R2"

Stop-vm-name "WINSERVER2008R2" –Force

6. Delete virtual machine

Remove-vm-name "WINSERVER2008R2" –Force

Note Deleting a virtual machine does not delete the virtual disk.

Summary:

This starts by testing the enterprise-class features of Windows Server 8 to preheat the upcoming next-generation Windows Server. PowerShell 3.0 plays a central role in almost all management operations, and subsequent chapters will continue to test the strange new features of Windows Server 8.

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.