What’s New in PowerShell For Hyper-V In Windows Server Technical Preview 1? #HyperV #PowerShell #vNext

Hello folks,

In October last year, Microsoft released Windows Server Technical Preview 1 bits along with System Center Technical Preview and Windows 10 Technical Preview.

On Friday evening January 3rd, 2015 Microsoft made the latest Windows 10 Technical Preview 2 available to the public. I see that 2015 will be an exciting year, however the final release of Windows Server vNext and System Center is not until 2016!    

In today’s blog post we will look at what’s new in PowerShell for Hyper-V in Windows Server 2016 Technical Preview 1.

The Hyper-V PowerShell module includes several significant features that extend its use, improve its usability, and allow you to control, automate and manage your Hyper-V environment.

Hyper-V in Windows Server 2012 R2 ships with 178 PowerShell cmdlets. These cmdlets allow a Hyper-V administrator to handle very simple, basic tasks to advanced ones such as setting up a Hyper-V replica for virtual machine disaster recovery.

If we look into PowerShell on Windows Server 2012 R2 and count the Hyper-V cmdlets that are available under our disposal.

PoSh-12R2-TP1-01

As you can see we have 178 cmdlets, let’s do the same on Windows Server TP1:

PoSh-12R2-TP1-02

As you can see we have 186 cmdlets in Hyper-V TP1 versus 178 in Hyper-V 2012 R2, so we have 8 new cmdlets so far.

What are these new cmdlets? Let’s compare the two modules side by side and explore the difference.

I will run the following cmdlets on a Hyper-V Technical Preview host:

PoSh-12R2-TP1-03

The result above will be a table telling you what’s different. Every PowerShell cmdlet that’s in the reference set (HyperV-2012R2-Reference.xml), but not in the difference set (HyperV-TP1-Compare.xml), will have a <= indicator (which indicates that the cmdlet is present only on the left side). However If a cmdlet is on the difference Hyper-V TP1 host but not on the reference 2012R2 host, it’ll have a => indicator which is our case here with 8 different cmdlets on the right side. Finally, PowerShell cmdlets that match across both sets won’t be included in the difference output.

All the previous PowerShell cmdlets that are available in Windows Server 2012 R2 Hyper-V are available as well in Windows Server Technical Preview in addition to the following:

Let’s deep dive and read the help for each of these new cmdlets.

I- Update-VMConfigurationVersion

PoSh-12R2-TP1-04

Microsoft in Windows Server technical preview introduced a new configuration file format for Virtual Machines which is designed to increase the efficiency of reading and writing virtual machine configuration data. It is also designed to reduce the potential for data corruption in the event of a storage failure. The new configuration files use the .VMCX extension (Replaced the old .XML files) for virtual machine configuration data, and the .VMRS extension (Replaced the old .VSV/.BIN files) for VM runtime state data.

The upgrade process is only through PowerShell no UI!

Let’s see the update VM configuration version in action.

PoSh-12R2-TP1-15

To upgrade the VM Configuration File for a Virtual Machine, you need to turn off the VM first, and then from an elevated Windows PowerShell command prompt run the following:

Let’s see now the difference after we update the configuration version for “FS01” Virtual Machine.

PoSh-12R2-TP1-16

II- Get-VMVideo, Set-VMVideo

PoSh-12R2-TP1-08PoSh-12R2-TP1-05

The Get-VMVideo and Set-VMVideo are used to modify the Synthetic Display Controller (Microsoft Hyper-V Video Resolution) for the virtual machine.

Let’s see how it works, first I will query the current Video settings for the VM.

PoSh-12R2-TP1-12

As you can see the Horizontal and Vertical Resolution is set to default 1920 X 1200.

In order to change the display resolution, you need to turn off the VM first, then change the resolution type as shown in above figure.

Let’s login to the virtual machine now and see the difference before and after we changed the display resolution.

Default @ 1920X1200:

PoSh-12R2-TP1-14

Custom @ 1024X768

PoSh-12R2-TP1-13

As you can see the resolution settings is grayed out now, and cannot be changed, it’s fixed to 1024 X 768.

One important point to mention, that this settings will take effect only when you login to the Virtual Machine without leveraging the Enhanced Session Mode feature that was introduced in Windows Server 2012 R2.

III- Get-VMAssignableDevice, Add-VMAssignableDevice, Remove-VMAssignableDevice

The Get-VMAssignableDevice, Add-VMAssignableDevice and the Remove-AssignableDevice are probably used to assign devices for Virtual Machines by either the Instance ID or the Location Path.

PoSh-12R2-TP1-15

IV- Mount-VMHostAssignableDevice, Dismount-VMHostAssignableDevice

The Mount-VMHostAssignableDevice, and Dismount-VMHostAssignableDevice are probably used to mount/dismount a device globally for the Hyper-V host, and this is by either the Instance ID or the Location Path as well.

However the help file is not completed and no PowerShell examples are available yet.

PoSh-12R2-TP1-16

I will update this blog post as soon as the next Technical Preview will come out Winking smile

Note: This is the current release of Technical Preview 9841 build, so we’ll have to wait and see the changes in the next bits…

Enjoy your day!

Cheers,
-Charbel

About Charbel Nemnom 325 Articles

Charbel Nemnom is a Microsoft Cloud Consultant and Technical Evangelist, totally fan of the latest’s IT platform solutions, accomplished hands-on technical professional with over 15 years of broad IT Infrastructure experience serving on and guiding technical teams to optimize performance of mission-critical enterprise systems. Excellent communicator adept at identifying business needs and bridging the gap between functional groups and technology to foster targeted and innovative IT project development. Well respected by peers through demonstrating passion for technology and performance improvement. Extensive practical knowledge of complex systems builds, network design and virtualization.

Be the first to comment

Leave a Reply