0
0
PowerShellscripting~10 mins

Get-ChildItem for listing in PowerShell - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to list all files and folders in the current directory.

PowerShell
Get-ChildItem [1]
Drag options to blanks, or click blank then click option'
A-Recurse
B-Force
C-Path .
D-File
Attempts:
3 left
💡 Hint
Common Mistakes
Using -Recurse when only the current directory is needed.
Using -File which lists only files, not folders.
2fill in blank
medium

Complete the code to list all files only in the current directory.

PowerShell
Get-ChildItem [1]
Drag options to blanks, or click blank then click option'
A-File
B-Directory
C-Force
D-Recurse
Attempts:
3 left
💡 Hint
Common Mistakes
Using -Directory which lists folders, not files.
Using -Recurse which lists files in subfolders too.
3fill in blank
hard

Fix the error in the code to list all items recursively.

PowerShell
Get-ChildItem [1]
Drag options to blanks, or click blank then click option'
A-Recurse
B-Directory
C-File
D-Force
Attempts:
3 left
💡 Hint
Common Mistakes
Using -File or -Directory alone does not recurse.
Forgetting to add -Recurse when subfolders are needed.
4fill in blank
hard

Fill both blanks to list all items recursively including hidden ones.

PowerShell
Get-ChildItem [1] [2]
Drag options to blanks, or click blank then click option'
A-Recurse
B-File
C-Force
D-Directory
Attempts:
3 left
💡 Hint
Common Mistakes
Using -File instead of -Force to include hidden items.
Forgetting -Recurse to include subfolders.
5fill in blank
hard

Fill all three blanks to list only directories recursively and show their full names.

PowerShell
Get-ChildItem [1] [2] | Select-Object [3]
Drag options to blanks, or click blank then click option'
A-Recurse
B-Directory
CFullName
D-File
Attempts:
3 left
💡 Hint
Common Mistakes
Using -File instead of -Directory to list folders.
Not using Select-Object FullName to see full paths.