Using PowerShell Direct
PowerShell Direct is a Hyper-V feature that allows you to open PowerShell remoting sessions to a VM without a network connection. This feature enables you to create a PowerShell remoting session to a VM to fix issues, such as networking misconfiguration. You can’t fix the issue without a working network connection to the VM, but until you fix the issue, you cannot make a connection to the VM. A “Catch-22” situation. With PowerShell Direct, you can create a remoting session in the VM, as seen in this recipe.
Getting ready
This recipe uses HV1
, a Windows Server Datacenter host on which you have installed the Hyper-V feature. You should have also created a VM of Windows Server called PSDirect
. This recipe demonstrates how to use PowerShell Direct, so it doesn’t matter which version of Windows Server you install so long as it is Windows Server 2016 or later (and you complete the installation of the OS inside the PSDirect
VM)...