PowerShell Genie

PowerShell practice: short, checked exercises

Build your first service report

Four checked skills: inspect properties, filter services, choose columns and produce CSV. Use the same fictional objects throughout, then apply the pipeline in a real admin project.

  1. 1. Read the propertiesPractise
  2. 2. Keep matching objectsPractise
  3. 3. Choose report columnsPractise
  4. 4. Export usable dataPractise

Four skills to practise. Progress stays in this browser; optional sign-in adds device sync.

Start: read the properties

Choose your next step

A short drill or a complete report

Start with five minutes of practice. Then move into CSV, JSON, functions, errors, remoting and testing through reasoning checkpoints and the weekly lab.

  1. Filter objects and shape a result.
  2. Export CSV, preserve JSON, and return objects from functions.
  3. Handle errors, keep partial results, and test failure behaviour.

Use these exercises to practise one pipeline skill at a time. Run supported commands against fictional data and check the result before moving on. Choose a lab when you want several steps in one task.

Not sure where to start? Follow a role-based learning path — Windows Admin, Helpdesk, and more — for a guided route through lessons and practice.

Practice Windows PowerShell 5.1 and PowerShell 7

Services: filter, sort & select 14 exercises

Drill Get-Service pipelines: filter by status and startup type, then sort and select. (Learn track: Objects and pipelines)

2 minIntermediate

Combine service filters

Return services that are both Running and Manual, sorted by Name. Both conditions must hold. Combine two conditions with -and before sorting the matching services.

2 minIntermediate

Find automatic services

Return services with an Automatic start type, sorted by Name. Filter StartType, then put the service names in alphabetical order.

2 minIntermediate

Find manual services

Return all services configured for Manual startup, including stopped services. Filter startup configuration without assuming that Manual services are stopped.

2 minIntermediate

Find running W services in reverse order

Return running services whose Name matches W*, sorted by Name in descending order. Combine a status test with a wildcard name match, then reverse the sort order.

2 minIntermediate

Find services outside automatic startup

Return every service whose StartType is not Automatic. Use an inequality test to include both Manual and Disabled startup types.

2 minIntermediate

Find stopped services

Return every stopped service from the sample machine. Read Status from each service object and keep only stopped services.

2 minIntermediate

Find the DNS service by name

Find the DNS client service in the fictional service inventory. Match the DNS client service by its service name, Dnscache.

2 minIntermediate

List running services

Return every running service. Use an equality test on Status to select running services.

2 minIntermediate

List service names beginning with W

Return the Name values of every service whose name begins with W, sorted alphabetically. Include stopped services. Match W* across every service, including stopped ones, then select Name.

2 minIntermediate

Reverse the service list

Return all services in descending Name order. Compare ascending and descending Name order without filtering out services.

2 minIntermediate

Sort the service list

Return every service, sorted alphabetically by Name. Sort service objects by Name while preserving every row.

2 minIntermediate

Take the first three service names

Sort service names alphabetically, then return the first three. Sort before taking the first three names; the stage order changes the result.

2 minIntermediate

Check stopped manual services

Return services that are both stopped and configured for Manual startup. Require both Stopped status and Manual startup with one compound filter.

2 minIntermediate

Verify a service-name exclusion

Return all other service names in alphabetical order. Exclude the named service, then sort and select the remaining names.

Processes: filter, sort & select 13 exercises

Drill Get-Process pipelines: CPU, memory, and working-set exercises. (Learn track: Objects and pipelines)

2 minIntermediate

Exclude the browser process

Return all processes except the one named chrome, sorted by Name. Use -ne to exclude chrome while keeping the other process objects.

2 minIntermediate

Filter accumulated CPU time

Return processes whose cumulative CPU time is greater than five seconds. Compare cumulative CPU seconds with a numeric threshold, rather than a percentage.

2 minIntermediate

Filter by memory use

Return processes with more than 100 MiB of working-set memory. The WS property is measured in bytes. Use PowerShell’s 100MB literal to compare the WS byte count.

2 minIntermediate

Find process IDs above 9000

Return processes whose Id is greater than 9000, sorted by Id. Filter numeric process IDs, then sort them numerically.

2 minIntermediate

Find processes below two CPU seconds

Return processes with cumulative CPU time below two seconds. Use -lt to select processes with less than two cumulative CPU seconds.

3 minIntermediate

Find the busiest processes

Return the two processes with the highest cumulative CPU time, highest first. CPU is measured in seconds, not percent. Sort CPU seconds descending before selecting the top two processes.

2 minIntermediate

Find the largest process below 100 MiB

Exclude processes using 100 MiB or more of working-set memory, then return the single largest remaining process. Filter memory first, then sort and select one remaining process.

2 minIntermediate

Find the largest working set

Return the one process with the largest WS value. Find the highest WS byte count by sorting before limiting the result.

2 minIntermediate

Find the smallest working sets

Return the three processes with the smallest working-set memory, smallest first. Sort all processes before limiting the result. Sort all working sets ascending before taking the smallest three.

2 minIntermediate

Inspect PowerShell processes

Return processes whose Name matches pw*, sorted by CPU descending. Match pw* process names, then rank their cumulative CPU time.

2 minIntermediate

Select the two busiest small processes

Among processes using less than 100 MiB of working-set memory, return the two with the highest cumulative CPU seconds, highest first. Apply the memory limit before ranking CPU time and taking two rows.

2 minIntermediate

Sort processes alphabetically

Return every process in ascending Name order. Sort process objects by Name without changing the number of objects.

2 minIntermediate

Compare process working sets

Return the two processes with the largest working sets. Rank processes by WS and select the two largest memory consumers.

Files, events & modules 3 exercises

Find large log files, inspect error events, and identify script modules. (Learn track: Shell foundations)

Active Directory 5 exercises

Audit disabled accounts, find team members, and sort the directory. (Learn track: Windows and Active Directory)

Azure 5 exercises

Review VM power states, resource groups, and inventory order. (Learn track: Remote and cloud administration)

Guided activities

Choose a longer challenge, a focused review or a visual walkthrough.

Genie guideFind a practice task

Four checked skills: inspect properties, filter services, choose columns and produce CSV. Use the same fictional objects throughout, then apply the pipeline in a real admin project.