Bird
0
0

Identify the error in this pipeline:

medium📝 Debug Q6 of 15
PowerShell - Cmdlets and Pipeline
Identify the error in this pipeline:
Get-ChildItem | Where-Object { $_.Length -gt 1000 } | Select Name, Length
APipeline operator | is missing
BWhere-Object cannot filter Length property
CGet-ChildItem does not output objects with Length
DSelect should be Select-Object to work correctly
Step-by-Step Solution
Solution:
  1. Step 1: Check cmdlet names

    Select is not a valid alias in PowerShell; the correct cmdlet is Select-Object.
  2. Step 2: Verify other parts

    Get-ChildItem outputs objects with Length property, and pipeline operator is present.
  3. Final Answer:

    Select should be Select-Object to work correctly -> Option D
  4. Quick Check:

    Use Select-Object, not Select [OK]
Quick Trick: Use full cmdlet names or valid aliases in pipelines [OK]
Common Mistakes:
  • Using invalid cmdlet aliases
  • Assuming Length property missing
  • Missing pipeline operator

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes