Objects, Not Text
Prerequisites: Finding commands and help
The biggest difference between PowerShell and traditional shells: output is objects. What you see on screen is just a formatted view of them.
Real-world analogy: a text shell hands you a printed report and you have to cut out the numbers with scissors. PowerShell hands you the spreadsheet itself — you can sort, filter, and pick columns by name.
An object has properties
$file = [pscustomobject]@{
Name = 'report.pdf'
SizeKB = 842
Modified = [datetime]'2025-04-20'
}
$file
$file.Name
$file.SizeKB * 1024
$file.Modified.DayOfWeek
Name SizeKB Modified
---- ------ --------
report.pdf 842 4/20/2025 12:00:00 AM
report.pdf
862208
Sunday
[pscustomobject]@{ ... } builds your own object (the Custom Objects
lesson covers this properly). Each property is accessed with a dot — and
properties keep their types: SizeKB is a number you can multiply, and
Modified is a date with its own properties.
Real commands return rich objects
$now = Get-Date -Year 2025 -Month 4 -Day 22 -Hour 9 -Minute 30 -Second 0
$now.Year
$now.DayOfWeek
$now.AddDays(10).ToString('yyyy-MM-dd')
($now | Get-Member -MemberType Property).Count -gt 10
2025
Tuesday
2025-05-02
True
A single Get-Date result carries a dozen properties and many methods —
no text parsing needed to get the year or add ten days.
Why this matters
In a text shell, getting "processes using more than 100 MB, sorted by memory" means knowing which column the memory is in and parsing numbers out of text. In PowerShell:
# illustrative
Get-Process | Where-Object WorkingSet -gt 100MB | Sort-Object WorkingSet -Descending
Properties are named, typed, and don't change when the display format
does. (100MB is a built-in number suffix: 104,857,600.)