Installing and configuring Hyper-V
With Windows Server 2019, to add Hyper-V to your server, you install the Hyper-V feature. This recipe installs Hyper-V on two servers: HV1 and HV2, which are domain-joined Windows 2019 servers with no added features.
Getting ready
In this recipe, you do the set up remotely from a client machine, CL1, using the Hyper-V cmdlets and PowerShell's remoting capabilities. CL1 is a domain-joined Windows 10 system with the RSAT tools installed. You previously set up the CL1 client in the Installing RSAT tools on Windows 10 and Windows Server 2019 recipe.
How to do it...
From
CL1, install the Hyper-V feature onHV1andHV2:$Sb = { Install-WindowsFeature -Name Hyper-V -IncludeManagementTools } Invoke-Command -ComputerName HV1, HV2 -ScriptBlock $SbReboot both servers to complete the installation:
Restart-Computer -ComputerName HV1, HV2 -Force
Create a
PSSessionwith both HV servers (after the restart has completed):$S = New-PSSession HV1, HV2
Create and set the location...