Bird
0
0

What happens when you run this command?

medium📝 Command Output Q5 of 15
PowerShell - Remote Management
What happens when you run this command?
Invoke-Command -ComputerName Server01 -ScriptBlock { Get-Date }
AReturns nothing because no output is specified
BReturns the current date and time from Server01
CThrows an error because Get-Date is invalid remotely
DReturns the date and time from the local computer
Step-by-Step Solution
Solution:
  1. Step 1: Understand Invoke-Command with Get-Date

    The command runs Get-Date on Server01 remotely, returning its date/time.
  2. Step 2: Confirm output source

    Output is from Server01, not local machine.
  3. Final Answer:

    Returns the current date and time from Server01 -> Option B
  4. Quick Check:

    Invoke-Command runs commands remotely = Returns the current date and time from Server01 [OK]
Quick Trick: Invoke-Command runs script block on remote machine [OK]
Common Mistakes:
  • Assuming output is local date/time
  • Thinking Get-Date cannot run remotely
  • Expecting no output without explicit return

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes