Bird
0
0

What will be the output of the following commands?

medium📝 Command Output Q13 of 15
PowerShell - Remote Management
What will be the output of the following commands?
Enter-PSSession -ComputerName Server01
Get-Process
Exit-PSSession
ALists processes running on Server01, then returns to local session
BLists processes running on local computer, then exits session
CThrows an error because Get-Process is invalid remotely
DStarts a new local PowerShell window
Step-by-Step Solution
Solution:
  1. Step 1: Understand Enter-PSSession effect

    The command opens a remote session on Server01, so subsequent commands run there.
  2. Step 2: Analyze commands inside session

    Get-Process runs on Server01, listing its processes. Exit-PSSession ends the remote session and returns to local.
  3. Final Answer:

    Lists processes running on Server01, then returns to local session -> Option A
  4. Quick Check:

    Commands run remotely inside Enter-PSSession = Lists processes running on Server01, then returns to local session [OK]
Quick Trick: Commands after Enter-PSSession run remotely until exit [OK]
Common Mistakes:
  • Assuming commands run locally after Enter-PSSession
  • Thinking Get-Process is invalid remotely
  • Confusing Exit-PSSession with closing PowerShell

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes