How it works...
Get-Process does not show you the process owner information by default. In some situations, it may be necessary to have this information. In this simple recipe, we use the help documentation to get all of the parameters and use the IncludeUserName switch parameter to get the process owner information.
In the next step, we filter out the processes started by a certain user and then count the number of processes. We do the same using Measure-Object as well and notice that the output is the same. Measure-Object has object in its name, but worked on text that was output by grep. At the same time, it said at the next step that the value of Property is invalid.
The answer to why Measure-Object worked when counting is in the step ...
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