Bird
0
0

Identify the error in this command:

medium📝 Debug Q6 of 15
PowerShell - Remote Management
Identify the error in this command:
Invoke-Command -ComputerName Server01 -ScriptBlock Get-Process
AIncorrect parameter name for computer
BNo error, command is correct
CGet-Process cannot be run remotely
DMissing curly braces around the script block
Step-by-Step Solution
Solution:
  1. Step 1: Check script block syntax

    The -ScriptBlock parameter requires a script block enclosed in curly braces { }.
  2. Step 2: Identify missing braces

    The command lacks { } around Get-Process, causing a syntax error.
  3. Final Answer:

    Missing curly braces around the script block -> Option D
  4. Quick Check:

    ScriptBlock needs { } [OK]
Quick Trick: Always wrap script block commands in { } [OK]
Common Mistakes:
  • Omitting curly braces for script block
  • Using wrong parameter names
  • Assuming all commands run remotely without syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes