Construct your own Custom PSObject

How to create your own Custom PSObjects.

Sometimes it is useful when curtain data is combined in one PSObject.
For instance we want to know the owner of the processes running on a machine
I am going to explain how to do this.

First we define an empty object

The second thing we are going to do is fetch some data to put into the Object.

After the data is fetched we add the data to the object.

And then we output the PSObject to the screen

Result :

Full script :

To make this ready for a module/function use the following :

Function :

Updated: December 20, 2015 — 22:29