Partager via


LanguagePrimitives.ConvertPSObjectToType Method

Definition

Converts PSObject to resultType.

public:
 static System::Object ^ ConvertPSObjectToType(System::Management::Automation::PSObject ^ valueToConvert, Type ^ resultType, bool recursion, IFormatProvider ^ formatProvider, bool ignoreUnknownMembers);
public static object ConvertPSObjectToType (System.Management.Automation.PSObject valueToConvert, Type resultType, bool recursion, IFormatProvider formatProvider, bool ignoreUnknownMembers);
static member ConvertPSObjectToType : System.Management.Automation.PSObject * Type * bool * IFormatProvider * bool -> obj
Public Shared Function ConvertPSObjectToType (valueToConvert As PSObject, resultType As Type, recursion As Boolean, formatProvider As IFormatProvider, ignoreUnknownMembers As Boolean) As Object

Parameters

valueToConvert
PSObject

Value to be converted and returned.

resultType
Type

Type to convert psobject.

recursion
Boolean

Indicates if inner properties have to be recursively converted.

formatProvider
IFormatProvider

To be used in custom type conversions, to call parse and to call Convert.ChangeType.

ignoreUnknownMembers
Boolean

Indicates if Unknown members in the psobject have to be ignored if the corresponding members in resultType do not exist.

Returns

Converted value.

Applies to