PowerShell Genie

Exercise Lab: assemble a working PowerShell pipeline

Guide 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

Start a mission

Exercise Lab asks you to assemble command blocks in the right order. It is useful when you recognise a cmdlet but are unsure which stage should come next. Use the other labs when you want to type the pipeline yourself.

Overview

POWERSHELL / EXERCISE LAB

Choose a skill below. Count the sample rows that match the task, enter your prediction, then click command blocks in order. Run your pipeline, investigate the error, and answer the final question.

First: count the matching sample objects and check your prediction.

No timer. No lost streaks. One pipeline, one diagnosis, one recall check.

  1. Build & run
  2. Diagnose & fix
  3. Recall

01 / PREDICT

Find busy processes

Return all processes with more than 5 cumulative CPU seconds, keeping their original properties.

Browser simulation · sample data — no real PowerShell execution or system changes.

CPU is cumulative processor time in seconds, not live CPU percentage. All values are sample data.

NameCPU
chrome42
Windows PowerShell18
notepad1
worker8

Inspect the sample objects and apply the task constraints.

02 / BUILD & RUN

Restored interactive mission flow

Predict, build, diagnose and explain

All runs use the site's fictional browser dataset. Nothing touches your machine.

1 · Predict

How many sample processes have more than 5 cumulative CPU seconds?

Mission 1

Busy processes

Keep CPU above 5 seconds, then sort highest first.

Mission 2

Stopped services

Return stopped services in alphabetical order.

Mission 3

Largest working sets

Sort processes by working set and keep the top two.

2 · Diagnose

The report shows the smallest CPU values first. Which check confirms the ordering direction before you edit anything?

3 · Recall

What does Get-Process CPU represent?

Make the pipeline

Click blocks in execution order. Each selected block can be removed. Keyboard: Tab, then Enter.

Show reference output
1 Choose your first block.

Check your prediction to enable Run.

03 / DIAGNOSE

Investigate before you fix

The report shows the smallest CPU values first.

Which inspection confirms the ordering direction?

Choose a diagnostic check.

Which fix puts the largest CPU values first?

04 / EXPLAIN

Keep the idea, not just the answer

What does Get-Process CPU measure?

Select the explanation that transfers to a real task.

MISSION COMPLETE

You tested the idea.

Prediction, pipeline, diagnosis and recall checked. This is a local practice result, not a certification.

Filter first to keep processes with more than 5 cumulative CPU seconds.

Sort-Object defaults to ascending order. Inspect the pipeline before changing the machine.

Alternative investigation: pipe the original objects to Get-Member to inspect their properties before composing filters.

Continue
Genie guideExercise Lab: assemble a working PowerShell pipeline

Exercise Lab asks you to assemble command blocks in the right order. It is useful when you recognise a cmdlet but are unsure which stage should come next. Use the other labs when you want to type the pipeline yourself.