Type System and Type Adaptation

PowerShell uses a type-adaptation system that masks all the details of these different objects’ representations. A PowerShell script never directly accesses an object. It always goes through the type-adaptation layer—the PSObject (PowerShell Object) layer—that rationalizes the interfaces presented to the user. The PSObject layer allows for a uniquely consistent user experience when working with the different types of objects.

 

The basic set of object adapters available in PowerShell

Adapted object type Description
.NET Adapter

This is the basic adapter for all .NET types. This adapter directly
maps the properties on the .NET object and adds several new
ones that start with a PS prefix.

COM Object Adapter

This adapter provides access to COM objects. Supported
objects include the Windows Script Host classes and scriptable
applications such as Microsoft Word or Internet Explorer.

WMI Adapter This adapts objects returned from a WMI provider.
ADO Adapter

This adapter allows you to treat the columns in ADO data
tables as though they were properties.

Custom Object Adapter

This adapter manages objects for which there’s no actual
underlying object, only synthetic properties.

ADSI Object Adapter

This adapts objects returned from the Active Directory Service
Interfaces.

posted @ 2012-11-28 18:47  HelloWorld.Michael  阅读(147)  评论(0)    收藏  举报