Bird
0
0

Why does this command fail?

medium📝 Debug Q7 of 15
PowerShell - Cmdlets and Pipeline
Why does this command fail?
Get-Member -InputObject Get-Process
ABecause Get-Member requires a pipeline input
BBecause -InputObject is not a valid parameter
CBecause Get-Member cannot inspect processes
DBecause Get-Process is a command, not an object instance
Step-by-Step Solution
Solution:
  1. Step 1: Understand -InputObject usage

    -InputObject expects an object instance, not a command or script.
  2. Step 2: Identify the error cause

    Passing the command Get-Process itself instead of its output causes failure.
  3. Final Answer:

    Because Get-Process is a command, not an object instance -> Option D
  4. Quick Check:

    -InputObject needs actual object, not command [OK]
Quick Trick: Pass object output, not command name, to -InputObject [OK]
Common Mistakes:
  • Passing commands instead of objects
  • Assuming pipeline is always required
  • Misunderstanding parameter purpose

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes