Share via


PSObject.AsPSObject(Object) Method

Definition

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

public:
 static System::Management::Automation::PSObject ^ AsPSObject(System::Object ^ obj);
public static System.Management.Automation.PSObject AsPSObject (object obj);
static member AsPSObject : obj -> System.Management.Automation.PSObject
Public Shared Function AsPSObject (obj As Object) As PSObject

Parameters

obj
Object

Object to be wrapped.

Returns

obj or a new PSObject whose BaseObject is obj

Exceptions

If obj is null.

Applies to