Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to list all files and then show only their names.
PowerShell
Get-ChildItem [1] Select-Object Name Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a parameter like -Filter instead of the pipeline symbol.
Using a dash '-' instead of the pipe '|'.
✗ Incorrect
The pipeline symbol '|' passes the output of Get-ChildItem to Select-Object to show only the Name property.
2fill in blank
mediumComplete the code to get all running processes and sort them by CPU usage.
PowerShell
Get-Process [1] Sort-Object CPU -Descending Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to use a parameter instead of the pipeline.
Using a comma or semicolon instead of '|'.
✗ Incorrect
The pipeline '|' passes the list of processes to Sort-Object to order them by CPU usage.
3fill in blank
hardFix the error in the code to filter services that are running.
PowerShell
Get-Service [1] Where-Object {$_.Status -eq 'Running'}
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a parameter like -Filter instead of the pipeline.
Missing the pipeline symbol causes a syntax error.
✗ Incorrect
The pipeline '|' is needed to send the output of Get-Service to Where-Object for filtering.
4fill in blank
hardFill both blanks to get all services, filter running ones, and select their names.
PowerShell
Get-Service [1] Where-Object {$_.Status -eq 'Running'} [2] Select-Object Name
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using parameters instead of pipelines between commands.
Missing one or both pipeline symbols.
✗ Incorrect
Use the pipeline '|' to connect Get-Service to Where-Object and then to Select-Object.
5fill in blank
hardFill all three blanks to get processes, filter by CPU > 100, and select their names.
PowerShell
Get-Process [1] Where-Object {$_.CPU [2] 100} [3] Select-Object Name
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using parameters instead of pipelines.
Using '=' instead of '-gt' for comparison.
Missing one of the pipeline symbols.
✗ Incorrect
Use pipelines '|' to connect commands and '-gt' to filter CPU usage greater than 100.