Bird
0
0

Which of the following is the correct syntax to get the list of running processes using CIM cmdlets?

easy📝 Syntax Q12 of 15
PowerShell - Remote Management
Which of the following is the correct syntax to get the list of running processes using CIM cmdlets?
AGet-CimInstance -ClassName Win32_Process
BGet-CimInstance Win32_Process
CGet-WmiObject -Class Win32_Process
DGet-Process -ClassName Win32_Process
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct syntax for Get-CimInstance

    The correct parameter to specify the class is -ClassName, so Get-CimInstance -ClassName Win32_Process is valid.
  2. Step 2: Check other options for syntax errors

    Get-CimInstance Win32_Process misses the parameter name, Get-WmiObject -Class Win32_Process uses Get-WmiObject (older cmdlet), and Get-Process -ClassName Win32_Process uses Get-Process incorrectly with a class parameter.
  3. Final Answer:

    Get-CimInstance -ClassName Win32_Process -> Option A
  4. Quick Check:

    Correct syntax uses -ClassName parameter [OK]
Quick Trick: Use -ClassName to specify CIM class in Get-CimInstance [OK]
Common Mistakes:
  • Omitting -ClassName parameter
  • Mixing Get-CimInstance with Get-WmiObject syntax
  • Using Get-Process with CIM class names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes