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 :

wvsandwijk

I am a Technical Specialist - Cloud Infrastructures from the Netherlands.
My Skills are mainly PowerShell, VMWare, Hyper-V, Microsoft System Center products and Windows Azure Pack.

I work for a company in Utrecht The Netherlands.
Updated: December 20, 2015 — 22:29