PSObject Class
Definition
- Namespace:
-
System.Management.Automation
- Assembly:
- System.Management.Automation.dll
- Package:
- Microsoft.PowerShell.5.1.ReferenceAssemblies v1.0.0
- Package:
- System.Management.Automation v7.4.15
- Package:
- System.Management.Automation v7.5.6
- Package:
- System.Management.Automation v7.6.1
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Wraps an object providing alternate views of the available members
and ways to extend them. Members can be methods, properties,
parameterized properties, etc.
public ref class PSObject : IComparable, IFormattable, System::Dynamic::IDynamicMetaObjectProvider, System::Runtime::Serialization::ISerializable
[System.Serializable]
public class PSObject : IComparable, IFormattable, System.Dynamic.IDynamicMetaObjectProvider, System.Runtime.Serialization.ISerializable
[System.ComponentModel.TypeDescriptionProvider(typeof(System.Management.Automation.PSObjectTypeDescriptionProvider))]
public class PSObject : IComparable, IFormattable, System.Dynamic.IDynamicMetaObjectProvider, System.Runtime.Serialization.ISerializable
[<System.Serializable>]
type PSObject = class
interface IFormattable
interface IComparable
interface ISerializable
interface IDynamicMetaObjectProvider
[<System.ComponentModel.TypeDescriptionProvider(typeof(System.Management.Automation.PSObjectTypeDescriptionProvider))>]
type PSObject = class
interface IFormattable
interface IComparable
interface ISerializable
interface IDynamicMetaObjectProvider
Public Class PSObject
Implements IComparable, IDynamicMetaObjectProvider, IFormattable, ISerializable
- Inheritance
-
- Attributes
-
- Implements
-
Remarks
It is permitted to subclass PSObject but there is no established scenario for doing this, nor has it been tested.
Constructors
Fields
Properties
| Name |
Description |
|
BaseObject
|
Gets the object we are wrapping.
|
|
ImmediateBaseObject
|
Gets the object we are directly wrapping.
|
|
Members
|
Gets the member collection.
|
|
Methods
|
Gets the Method collection, or the members that are actually methods.
|
|
Properties
|
Gets the Property collection, or the members that are actually properties.
|
|
TypeNames
|
Gets the type names collection initially containing the object type hierarchy.
|
Methods
| Name |
Description |
|
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)
|
Compares the current instance with another object of the same type.
|
|
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)
|
Determines whether the specified Object is equal to the current Object.
|
|
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)
|
Implements the ISerializable contract for serializing a PSObject.
|
|
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)
|
Returns the string representation for this object. A ToString
CodeMethod or ScriptMethod will be used, if available. Enumerations items are
concatenated using $ofs.
|
Operators
Explicit Interface Implementations