Color theme
0 day streak0 XPP1
PowerShellLearn mode
MISSION 1 OF 1

Format a print request

0 XP earned
PowerShell track: IntermediateMission: IntermediateCustom objectsProperty accessComposite formatting
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.

x
0 / 2 challenges
LEARN THE CONCEPT

Understand it, then try it.

A custom object groups related values into named properties. Dot notation reads each property, and the -f format operator inserts values into numbered placeholders. Placeholder 0 receives the first supplied value and placeholder 1 receives the second. A print desk can use this to make predictable text from a request.

report.ps1
$request = [pscustomobject]@{ Name = "Poster"; Copies = 14 }$template = "{0}: {1}"$summary = $template -f $request.Name, $request.CopiesWrite-Output $summary

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.