Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to send the output of Get-Process to the pipeline.
PowerShell
Get-Process | [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Write-Host breaks the pipeline by converting objects to text.
Get-Item and New-Item do not accept pipeline input from Get-Process.
✗ Incorrect
The pipeline sends objects from Get-Process to Sort-Object to sort the processes.
2fill in blank
mediumComplete the code to filter processes with CPU usage greater than 100.
PowerShell
Get-Process | Where-Object { $_.CPU [1] 100 } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' filters processes with CPU less than 100, which is opposite.
Using '-eq' or '-ne' checks for equality or inequality, not greater than.
✗ Incorrect
The '>' operator filters processes where CPU usage is greater than 100.
3fill in blank
hardFix the error in the pipeline to select the process names only.
PowerShell
Get-Process | Select-Object -Property [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting 'Id' or 'CPU' returns other properties, not the names.
Selecting 'Path' may return null for some processes.
✗ Incorrect
Selecting the 'Name' property returns the process names as objects in the pipeline.
4fill in blank
hardFill both blanks to create a pipeline that gets services and filters only running ones.
PowerShell
Get-Service | Where-Object { $_.[1] -eq '[2]' } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Name' instead of 'Status' as the property.
Filtering for 'Stopped' instead of 'Running'.
✗ Incorrect
Filtering services where Status equals 'Running' shows only running services.
5fill in blank
hardFill all three blanks to create a pipeline that gets processes, selects their names and CPU, and filters those with CPU over 50.
PowerShell
Get-Process | Select-Object [1], [2] | Where-Object { $_.[3] -gt 50 }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting 'Id' instead of 'CPU' for filtering.
Filtering on a property not selected in Select-Object.
✗ Incorrect
Select 'Name' and 'CPU' properties, then filter where CPU is greater than 50.