One of the big differences between PowerShell on Windows and Bash on Linux is this:

We’ll commonly use the pipe | character to chain PowerShell commands together. In this first example, let’s examine all the properties and methods associated with processes returned to us when we type get-process.

Type:

get-process | get-member

Untitled

Get-Member is frequently used. An alias exists to make our lives easier. Instead of typing the previous command, we could also type:

get-process | gm

We’ll focus on Properties for this lab. (Make sure the calculator app is running for this.) Let’s start by looking at the properties that are returned by default. Type:

get-process Calculator 

Untitled

By default this cmdlet will return properties like ‘ProcessName’, ‘ProcessID’, and ‘CPU’ usage. However, the list of members we generated had many more properties on it than what we see here.

For example, the list of members contained items like: ‘StartTime, FileVersion, and Path.

Untitled

We can choose to only return members we are interested in instead.

get-process calculator | select-object StartTime, FileVersion, Path

Untitled

You are probably thinking ‘Bogus again! That’s hard to read man!’ —You would be right.

Within PowerShell, we can format output in various ways to make it more readable. We can always pipe our commands to the format-list cmdlet to make it more readable like this.