How it works...
The cmdlet, Get-Process, gives out an entire table of all of the processes running in the system. Think of each row as an individual object and the entire table as an array of these rows. Count (or in other words, length) is, logically, a property of an array. Therefore, we call the cmdlet and, on the object that is output, we run a counting operation. This gives us how many processes are running in the system at the moment.
The next cmdlet we see is an important one, as well: Measure-Object. This cmdlet is designed to perform measurements on the objects that are output. In our case, we pick the WS property to perform measurements on. If no property is specified, PowerShell will pick the property based on its definition in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access