Windows PowerShell command blocks for Hyper-V configurations

Hey TLG and automation fans,

Continuing the drive toward better automation for setting up test labs based on Test Lab Guides (TLGs), I have added Windows PowerShell command blocks to the eight topics that describe how to create test lab environments in Windows Server 2012 Hyper-V.

Each command block is the set of Windows PowerShell commands that you run on the Hyper-V server that create the same virtual networks and virtual machines as described in the numbered procedure.

Here is an example for building out the Corpnet subnet of the Windows Server 2012 base configuration:

Windows PowerShell commands

The following Windows PowerShell cmdlet or cmdlets perform the same function as steps 1-4 of the preceding procedure. You must supply values for the  –MemoryStartupBytes and  -NewVHDSizeBytes parameters for each virtual machine.Enter each cmdlet on a single line, even though they may appear word-wrapped across several lines here because of formatting constraints.

New-VmSwitch -Name Corpnet -SwitchType Private New-VM –Name DC1 –MemoryStartupBytes <MemorySize> -NewVHDSizeBytes <DiskSize> –SwitchName CorpnetNew-VM –Name APP1 –MemoryStartupBytes <MemorySize> -NewVHDSizeBytes <DiskSize> –SwitchName Corpnet New-VM –Name CLIENT1 –MemoryStartupBytes <MemorySize> -NewVHDSizeBytes <DiskSize> –SwitchName Corpnet


You can get to all of these topics from Hosting Test Lab Guide Environments in Windows Server 2012 Hyper-V.

For more information about TLGs, see Test Lab Guides.




Joe Davies