Freigeben über


PSTypeConverter.ConvertTo Method

Definition

Overloads

ConvertTo(PSObject, Type, IFormatProvider, Boolean)

Converts the sourceValue parameter to the destinationType parameter using formatProvider and ignoreCase.

ConvertTo(Object, Type, IFormatProvider, Boolean)

Converts the sourceValue parameter to the destinationType parameter using formatProvider and ignoreCase.

ConvertTo(PSObject, Type, IFormatProvider, Boolean)

Converts the sourceValue parameter to the destinationType parameter using formatProvider and ignoreCase.

public:
 virtual System::Object ^ ConvertTo(System::Management::Automation::PSObject ^ sourceValue, Type ^ destinationType, IFormatProvider ^ formatProvider, bool ignoreCase);
public virtual object ConvertTo (System.Management.Automation.PSObject sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase);
abstract member ConvertTo : System.Management.Automation.PSObject * Type * IFormatProvider * bool -> obj
override this.ConvertTo : System.Management.Automation.PSObject * Type * IFormatProvider * bool -> obj
Public Overridable Function ConvertTo (sourceValue As PSObject, destinationType As Type, formatProvider As IFormatProvider, ignoreCase As Boolean) As Object

Parameters

sourceValue
PSObject

Value supposedly from one of the types supported by this converter to be converted to the destinationType parameter.

destinationType
Type

Type to convert the sourceValue parameter, supposedly not one of the types supported by the converter.

formatProvider
IFormatProvider

The format provider to use like in IFormattable's ToString.

ignoreCase
Boolean

True if case should be ignored.

Returns

SourceValue converted to the destinationType parameter using formatProvider and ignoreCase.

Exceptions

If no conversion was possible.

Applies to

ConvertTo(Object, Type, IFormatProvider, Boolean)

Converts the sourceValue parameter to the destinationType parameter using formatProvider and ignoreCase.

public:
 abstract System::Object ^ ConvertTo(System::Object ^ sourceValue, Type ^ destinationType, IFormatProvider ^ formatProvider, bool ignoreCase);
public abstract object ConvertTo (object sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase);
abstract member ConvertTo : obj * Type * IFormatProvider * bool -> obj
Public MustOverride Function ConvertTo (sourceValue As Object, destinationType As Type, formatProvider As IFormatProvider, ignoreCase As Boolean) As Object

Parameters

sourceValue
Object

Value supposedly from one of the types supported by this converter to be converted to the destinationType parameter.

destinationType
Type

Type to convert the sourceValue parameter, supposedly not one of the types supported by the converter.

formatProvider
IFormatProvider

The format provider to use like in IFormattable's ToString.

ignoreCase
Boolean

True if case should be ignored.

Returns

SourceValue converted to the destinationType parameter using formatProvider and ignoreCase.

Exceptions

If no conversion was possible.

Applies to