Bird
0
0

Which of the following is the correct syntax to start an interactive SSH-based PowerShell session to a remote computer named Server01?

easy📝 Syntax Q12 of 15
PowerShell - Remote Management
Which of the following is the correct syntax to start an interactive SSH-based PowerShell session to a remote computer named Server01?
AEnter-PSSession -HostName Server01
BInvoke-Command -Session Server01 -SSH
CEnter-PSSession -ComputerName Server01 -UseSSH
DNew-PSSession -ComputerName Server01
Step-by-Step Solution
Solution:
  1. Step 1: Recall Enter-PSSession syntax for SSH remoting

    PowerShell 7+ uses Enter-PSSession -HostName <name> to start SSH sessions.
  2. Step 2: Compare options

    Enter-PSSession -HostName Server01 uses -HostName Server01, which is correct for SSH remoting. Enter-PSSession -ComputerName Server01 -UseSSH uses -ComputerName with -UseSSH which is invalid syntax. Invoke-Command -Session Server01 -SSH mixes parameters incorrectly. New-PSSession -ComputerName Server01 creates a session but does not specify SSH or hostname properly.
  3. Final Answer:

    Enter-PSSession -HostName Server01 -> Option A
  4. Quick Check:

    SSH session uses -HostName parameter [OK]
Quick Trick: Use Enter-PSSession with -HostName for SSH [OK]
Common Mistakes:
  • Using -ComputerName instead of -HostName for SSH
  • Mixing Invoke-Command with session parameters
  • Omitting SSH-specific parameters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes