Bird
0
0

Which PowerShell command syntax correctly executes a script block on multiple remote computers?

easy📝 Syntax Q3 of 15
PowerShell - Remote Management
Which PowerShell command syntax correctly executes a script block on multiple remote computers?
AInvoke-RemoteCommand -Computers ServerA,ServerB -ScriptBlock { Get-Process }
BInvoke-Remote -Computer ServerA,ServerB -Command { Get-Process }
CInvoke-Command -Computer ServerA,ServerB -Script { Get-Process }
DInvoke-Command -ComputerName ServerA,ServerB -ScriptBlock { Get-Process }
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct cmdlet

    Invoke-Command is the standard cmdlet for remote execution in PowerShell.
  2. Step 2: Check parameter names

    The correct parameter for specifying remote computers is -ComputerName, and the script block is passed with -ScriptBlock.
  3. Final Answer:

    Invoke-Command -ComputerName ServerA,ServerB -ScriptBlock { Get-Process } -> Option D
  4. Quick Check:

    Invoke-Command with -ComputerName and -ScriptBlock [OK]
Quick Trick: Use Invoke-Command with -ComputerName and -ScriptBlock [OK]
Common Mistakes:
  • Using incorrect cmdlet names like Invoke-Remote
  • Using wrong parameter names like -Computer or -Script
  • Confusing script block syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes