4

Working with Objects in PowerShell

Everything in PowerShell revolves around working with objects. An object is a representation of a thing, and realistically, that can be anything. However, at this stage, it is better to stick with things PowerShell already does.

The Get-Process command in PowerShell returns objects that represent running processes in the operating system. The processes are broadly described by the Process type.

Type is a term .NET uses to describe the abstract representation of a thing. Abstract because it does not represent any single process (in this case), but how a process should look to the programming language (like PowerShell).

A single specific process is represented by an instance of the Type.

At this point, it can ...

Get Mastering PowerShell Scripting - Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.