PSTypeConverter.ConvertTo PSTypeConverter.ConvertTo PSTypeConverter.ConvertTo Method

Definition

Overloads

ConvertTo(PSObject, Type, IFormatProvider, Boolean) ConvertTo(PSObject, Type, IFormatProvider, Boolean) ConvertTo(PSObject, Type, IFormatProvider, Boolean)

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

ConvertTo(Object, Type, IFormatProvider, Boolean) ConvertTo(Object, Type, IFormatProvider, Boolean) ConvertTo(Object, Type, IFormatProvider, Boolean)

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

ConvertTo(PSObject, Type, IFormatProvider, Boolean) ConvertTo(PSObject, Type, IFormatProvider, Boolean) ConvertTo(PSObject, Type, IFormatProvider, Boolean)

Converts the sourceValue parameter to the destinationType parameter using formatProvider and 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 PSObject PSObject

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

destinationType
Type Type Type

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

formatProvider
IFormatProvider IFormatProvider IFormatProvider

The format provider to use like in IFormattable's ToString

ignoreCase
Boolean Boolean Boolean

true if case should be ignored

Returns

sourceValue converted to the destinationType parameter using formatProvider and ignoreCase

Exceptions

ConvertTo(Object, Type, IFormatProvider, Boolean) ConvertTo(Object, Type, IFormatProvider, Boolean) ConvertTo(Object, Type, IFormatProvider, Boolean)

Converts the sourceValue parameter to the destinationType parameter using formatProvider and 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 Object Object

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

destinationType
Type Type Type

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

formatProvider
IFormatProvider IFormatProvider IFormatProvider

The format provider to use like in IFormattable's ToString

ignoreCase
Boolean Boolean Boolean

true if case should be ignored

Returns

sourceValue converted to the destinationType parameter using formatProvider and ignoreCase

Exceptions

Applies to