O'Reilly logo

Pro Windows PowerShell by Hristo Deshev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12.1. Modifying Objects and Types

As we already discussed in Chapter 1, a PowerShell object is a complex animal. Whenever you get an object instance, you do not really manipulate the original object no matter where it is coming from: .NET, COM, WMI, or elsewhere. All objects in PowerShell are really instances of the PSObject type or its inheritors. The PSObject type is the basis—the foundation of the extended type system. It is implemented as an object wrapper, and it holds a reference to the real object. The operations that we perform on the real object all go through the PSObject instance, where they can be intercepted and manipulated by the type system. This allows for exposing functionality by adding properties and methods that are not present ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required