Filter long practice sessions
Before you start this intermediate track
Terminal basics and object properties. The lessons use pipelines and script blocks.
Guided code reading and debugging. Runnable coding challenges are available in JavaScript, Python, and SQL.
Understand it, then try it.
Where-Object retains objects whose script-block test is true. Inside the block, $_ is the current duration, and -gt means strictly greater than. A music teacher uses this comparison to list practice sessions longer than a chosen limit. Filtering keeps the original durations and their original order.
$durations = @(2, 9, 4, 16, 7)$limit = 7$selected = $durations | Where-Object { $_ -gt $limit }Write-Output ($selected -join ", ")Run each mission separately in PowerShell 7. These snippets only create in-memory values and print reports; they do not read or modify files, services, or system settings.
Track the values line by line. Predict the result before running this example in your own editor.