Bird
0
0

What will this command output?

medium📝 Command Output Q5 of 15
PowerShell - Cmdlets and Pipeline
What will this command output?
Get-ChildItem | Get-Member -MemberType Property
AA list of all files and folders in the directory
BA list of properties for each file and folder object
CAn error because Get-ChildItem does not output objects
DA list of methods for each file and folder object
Step-by-Step Solution
Solution:
  1. Step 1: Understand Get-ChildItem output

    Get-ChildItem outputs file and folder objects representing items in a directory.
  2. Step 2: Get-Member with -MemberType Property

    This filters the output to show only properties of those objects.
  3. Final Answer:

    A list of properties for each file and folder object -> Option B
  4. Quick Check:

    MemberType Property lists object properties [OK]
Quick Trick: Use -MemberType Property to see object details [OK]
Common Mistakes:
  • Expecting file list instead of properties
  • Confusing properties with methods
  • Thinking Get-ChildItem outputs text only

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes