Add Custom Methods and Properties to Objects
1. Problem
You have an object and want to add your own custom properties or methods (members) to that object.
2. Solution
Use the Add-Member cmdlet to add custom members to an object.
3. Discussion
The Add-Member cmdlet is extremely useful in helping you add custom members to individual objects. For example, imagine that you want to create a report [...]
Types and Objects
1. Problem
You have an instance of an object and want to know what methods and properties it supports.
2. Solution
The most common way to explore the methods and properties supported by an object is through the Get-Member cmdlet.
To get the instance members of an object you’ve stored in the $object variable, pipe it to the Get-Member [...]
Use a COM Object
1. Problem
You want to create a COM object to interact with its methods and properties.
2. Solution
Use the New-Object cmdlet (with the –ComObject parameter) to create a COM object from its ProgID. You can then interact with the methods and properties of the COM object as you would any other object in PowerShell.
       $object = New-Object [...]
Create an Instance of a .NET Object
1. Problem
You want to create an instance of a .NET object to interact with its methods and properties.
2. Solution
Use the New-Object cmdlet to create an instance of an object.
To create an instance of an object using its default constructor, use the New-Object cmdlet with the class name as its only parameter:
       PS >$generator = New-Object [...]
Work with .NET Objects
1. Problem
You want to use and interact with one of the features that make PowerShell so powerful—its intrinsic support for .NET objects.
2. Solution
PowerShell offers ways to access methods (both static and instance) and properties.
To call a static method on a class, place the type name in square brackets, and then separate the class name from [...]
Simplify Most Where-Object Filters
The Where-Object cmdlet is incredibly powerful, in that it allows you to filter your output based on arbitrary criteria. For extremely simple filters (such as filtering based only on a comparison to a single property), though, the syntax can get a little ungainly:
       Get-Process | Where-Object { $_.Handles -gt 1000 }
For this type of situation, [...]

