Bird
0
0

When you run Get-ChildItem in PowerShell without any parameters, what items are displayed?

easy📝 Conceptual Q1 of 15
PowerShell - File and Directory Operations
When you run Get-ChildItem in PowerShell without any parameters, what items are displayed?
AOnly files in the current location
BBoth files and directories in the current location
COnly directories in the current location
DOnly hidden files and folders
Step-by-Step Solution
Solution:
  1. Step 1: Understand default behavior

    By default, Get-ChildItem lists all child items in the current directory, including both files and folders.
  2. Step 2: No filters applied

    Since no parameters like -File or -Directory are specified, it returns all items.
  3. Final Answer:

    Both files and directories in the current location -> Option B
  4. Quick Check:

    Default lists files and folders [OK]
Quick Trick: Default lists files and folders [OK]
Common Mistakes:
  • Assuming it lists only files
  • Assuming it lists only directories
  • Thinking it lists hidden items only

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes