Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Manage VMs remotely by using PowerShell, PowerShell Direct, and SSH Direct for Linux guests

A worked example

Single answer

APP01 is a running Windows Server 2025 VM on a local Hyper-V host. PowerShell Direct is working for the VM, but APP01 has no network connectivity. An administrator has an elevated Windows PowerShell console on the host and valid guest credentials.

Which command opens an interactive PowerShell prompt inside APP01?

Choose one answer
Why

Enter-PSSession with VMName starts an interactive session through PowerShell Direct. The guest does not need network connectivity for this connection.

  • Not correct: New-PSSession -VMName 'APP01'. New-PSSession creates a persistent session in the background. Creating that session does not enter its interactive prompt.
  • Correct: Enter-PSSession -VMName 'APP01'. The VMName parameter selects PowerShell Direct, and Enter-PSSession opens an interactive session inside the VM.
  • Not correct: Invoke-Command -VMName 'APP01' -ScriptBlock { hostname }. This runs one command through PowerShell Direct and then closes its connection. It does not open an interactive prompt.
  • Not correct: Enter-PSSession -ComputerName 'APP01'. The ComputerName form uses network PowerShell remoting. APP01 is unreachable through that connection method in this scenario.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free