Exploring .NET objects

An object is nothing but a combination of methods and properties in PowerShell. Using Windows PowerShell, we can store a reference to an object to a variable and use it in the current shell as required.

We discussed in Chapter 1, Getting Started with Windows PowerShell that PowerShell takes advantage of the underlying .NET framework. So, the objects are a representation of the parts and actions to use it. An object is a combination of the properties and methods (Objects = Properties + Methods).

For example, a Windows service object has properties and methods. The properties are Get and Set, and the methods are invoked to perform a meaningful operation.

Consider the following image:

Creating .NET objects

We have discussed objects ...

Get Windows PowerShell for .NET Developers - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.