0
0
PowerShellscripting~5 mins

Get-ChildItem for listing in PowerShell - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the PowerShell cmdlet <code>Get-ChildItem</code> do?

Get-ChildItem lists files and folders in a directory, similar to 'ls' in Linux or 'dir' in Windows Command Prompt.

Click to reveal answer
beginner
How do you list all files including hidden ones using Get-ChildItem?

Use the -Force parameter: Get-ChildItem -Force shows all files, including hidden and system files.

Click to reveal answer
beginner
What parameter do you use with Get-ChildItem to list items recursively in all subfolders?

Use the -Recurse parameter: Get-ChildItem -Recurse lists all files and folders inside the current folder and all its subfolders.

Click to reveal answer
beginner
How can you filter files by extension using Get-ChildItem?

Use the -Filter parameter with a pattern, for example: Get-ChildItem -Filter *.txt lists only text files.

Click to reveal answer
intermediate
What is the difference between Get-ChildItem and Get-Item?

Get-ChildItem lists contents inside a folder (files and folders). Get-Item gets a specific file or folder itself.

Click to reveal answer
Which parameter with Get-ChildItem lists all files including hidden ones?
A-Recurse
B-Filter
C-Force
D-Hidden
How do you list all files in current folder and all subfolders?
AGet-ChildItem -Filter *
BGet-ChildItem -Hidden
CGet-ChildItem -Force
DGet-ChildItem -Recurse
What command lists only text files in a folder?
AGet-ChildItem -Force *.txt
BGet-ChildItem -Filter *.txt
CGet-ChildItem -Recurse *.txt
DGet-ChildItem -Hidden *.txt
Which cmdlet gets a specific file or folder itself, not its contents?
AGet-Item
BGet-ChildItem
CGet-Content
DGet-File
What does Get-ChildItem without parameters do?
ALists files and folders in current directory
BDeletes files in current directory
CCreates a new folder
DShows system info
Explain how to use Get-ChildItem to list all files including hidden ones and files in subfolders.
Think about parameters that show hidden files and go into subfolders.
You got /4 concepts.
    Describe how to filter files by extension using Get-ChildItem and why this might be useful.
    Filtering helps find only certain types of files quickly.
    You got /4 concepts.