Bird
0
0

What is wrong with this command?

medium📝 Debug Q7 of 15
PowerShell - Remote Management
What is wrong with this command?
Invoke-Command -ComputerName Server01,Server02 -ScriptBlock { Get-Service } -Computer Server03
ADuplicate computer parameters cause an error
BGet-Service cannot be used in script blocks
CScriptBlock parameter is missing
DInvoke-Command does not support multiple computers
Step-by-Step Solution
Solution:
  1. Step 1: Review parameters

    Invoke-Command uses -ComputerName to specify targets; here it appears twice.
  2. Step 2: Identify duplicate parameter issue

    Having both -ComputerName and -Computer causes a parameter conflict error.
  3. Final Answer:

    Duplicate computer parameters cause an error -> Option A
  4. Quick Check:

    Duplicate parameters cause errors = Duplicate computer parameters cause an error [OK]
Quick Trick: Use only one computer parameter: -ComputerName [OK]
Common Mistakes:
  • Using multiple computer parameters
  • Thinking Get-Service can't run remotely
  • Assuming multiple computers not supported

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes