1. Create VMs
# Example syntax to create a VM using NewLabVM.ps1
# Run from host running Hyper-V

$Parameters = @{
    LabName           = LAB01
    VMHostname        = LAB01DC01A
    MemoryStartupMB   = 1024
    MemoryMaximumMB   = 2048
    ProcessorCount    = 2
    VirtualSwitchName = INTERNAL
    DiskCount         = 1
    VHDPath           = 'D:\Virtual Hard Disks\'
    VHDSizeGB         = 100
    ISOPath           = 'D:\Software\20348.169.210806-2348.fe_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso'
    Verbose           = $true
}

.\NewLabVM.ps1 @Parameters
  1. Power on VMs and install OS
  2. Set Administrator password
    • This password will be used for further automation
    • I tend to use New-Guid to generate a “random” password
  3. Configure VMs
# Example syntax to configure a VM using ConfigureLabVM.ps1
# Run from host running Hyper-V

$Parameters = @{
    LabName        = LAB01
    VMHostname     = LAB01DC01A
    Username       = Administrator
    Password       = 'bf1456b8-a91f-4a41-92a8-8388ff07dd6d'
    IPAddress      = 192.168.1.11
    PrefixLength   = 24
    DefaultGateway = 192.168.1.1
    DNSServer      = 192.168.1.1
    TimeZoneID     = 'Eastern Standard Time'
    Verbose        = $true
}

.\ConfigureLabVM.ps1 @Parameters