PSObject PSObject PSObject Class

Definition

Wraps an object providing alternate views of the available members and ways to extend them. Members can be methods, properties, parameterized properties, etc.

[System.ComponentModel.TypeDescriptionProvider(typeof(System.Management.Automation.PSObjectTypeDescriptionProvider))]
public class PSObject : IComparable, IFormattable, System.Dynamic.IDynamicMetaObjectProvider, System.Runtime.Serialization.ISerializable
type PSObject = class
    interface IFormattable
    interface IComparable
    interface ISerializable
    interface IDynamicMetaObjectProvider
Public Class PSObject
Implements IComparable, IDynamicMetaObjectProvider, IFormattable, ISerializable
Inheritance
PSObjectPSObjectPSObject
Attributes
Implements

Remarks

It is permitted to subclass PSObject but there is no established scenario for doing this, nor has it been tested.

Constructors

PSObject() PSObject() PSObject()

Initializes a new instance of PSObject with an PSCustomObject BaseObject

PSObject(Object) PSObject(Object) PSObject(Object)

Initializes a new instance of PSObject wrapping obj (accessible through BaseObject).

PSObject(SerializationInfo, StreamingContext) PSObject(SerializationInfo, StreamingContext) PSObject(SerializationInfo, StreamingContext)

Creates a PSObject from an ISerializable context

Fields

AdaptedMemberSetName AdaptedMemberSetName AdaptedMemberSetName

The name of the member set for adapted members

BaseObjectMemberSetName BaseObjectMemberSetName BaseObjectMemberSetName

The name of the member set for the BaseObject's members

ExtendedMemberSetName ExtendedMemberSetName ExtendedMemberSetName

The name of the member set for extended members

Properties

BaseObject BaseObject BaseObject

Gets the object we are wrapping.

ImmediateBaseObject ImmediateBaseObject ImmediateBaseObject

Gets the object we are directly wrapping.

Members Members Members

Gets the member collection

Methods Methods Methods

Gets the Method collection, or the members that are actually methods.

Properties Properties Properties

Gets the Property collection, or the members that are actually properties.

TypeNames TypeNames TypeNames

Gets the type names collection initially containing the object type hierarchy.

Methods

AsPSObject(Object) AsPSObject(Object) AsPSObject(Object)

If obj is an PSObject it will be returned as is, otherwise a new PSObject will be created based on obj.

CompareTo(Object) CompareTo(Object) CompareTo(Object)

Compares the current instance with another object of the same type.

Copy() Copy() Copy()

Returns a copy of this PSObject. This will copy the BaseObject if it is a value type, and use BaseObject.Clone() for the new PSObject, if the BaseObject is ICloneable.

Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified Object is equal to the current Object.

GetHashCode() GetHashCode() GetHashCode()

Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.

GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext)

Implements the ISerializable contract for serializing a PSObject

ToString() ToString() ToString()

Returns the string representation for this object. A ToString CodeMethod or ScriptMethod will be used, if available. Enumerations items are concatenated using $ofs.

ToString(String, IFormatProvider) ToString(String, IFormatProvider) ToString(String, IFormatProvider)

Returns the string representation for this object. A ToString CodeMethod or ScriptMethod will be used, if available. Enumerations items are concatenated using $ofs.

Operators

Implicit(Boolean to PSObject) Implicit(Boolean to PSObject) Implicit(Boolean to PSObject)
Implicit(Hashtable to PSObject) Implicit(Hashtable to PSObject) Implicit(Hashtable to PSObject)
Implicit(Double to PSObject) Implicit(Double to PSObject) Implicit(Double to PSObject)
Implicit(Int32 to PSObject) Implicit(Int32 to PSObject) Implicit(Int32 to PSObject)
Implicit(String to PSObject) Implicit(String to PSObject) Implicit(String to PSObject)

Explicit Interface Implementations

IDynamicMetaObjectProvider.GetMetaObject(Expression) IDynamicMetaObjectProvider.GetMetaObject(Expression) IDynamicMetaObjectProvider.GetMetaObject(Expression)

Applies to