We now know how to create a custom object from scratch. In this recipe, we will use a returned object and modify the returned object to create a custom object. When we look at loops, we will extend this capability to create versatile custom objects; in production environments, this capability can be used to do more!
Creating a custom object from a returned object
How to do it...
The first step to learning something is to simplify it. Therefore, we will select only one instance of an object and work with it. Follow these steps to get started:
- Get all of the processes. Select only the name, ID, working set, and the start time, pick the fifth process in the list, and assign it to a variable:
PS> $Process = (Get-Process ...