Objects and Properties

View saved

See members

Get-Member shows properties and methods.

Get-Process | Get-Member
Get-ChildItem | Get-Member

Read a property

Use dot notation on a single object, or Select-Object in a pipeline.

(Get-Date).Year
Get-Process | Select-Object -First 1 -ExpandProperty ProcessName

Format for humans

Formatting cmdlets are for display near the end of a pipeline—not for further processing.

Get-Service | Format-Table -AutoSize
Get-Process | Format-List *

Keep objects flowing

Avoid converting to strings early if the next command expects objects.

Comments

One comment per signed-in account. Comments are saved with this page’s URL.