PSTypeConverter.ConvertFrom Method
Definition
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.
Overloads
ConvertFrom(PSObject, Type, IFormatProvider, Boolean) |
Converts the |
ConvertFrom(Object, Type, IFormatProvider, Boolean) |
Converts the |
ConvertFrom(PSObject, Type, IFormatProvider, Boolean)
Converts the sourceValue
parameter to the destinationType
parameter using formatProvider and ignoreCase.
public:
virtual System::Object ^ ConvertFrom(System::Management::Automation::PSObject ^ sourceValue, Type ^ destinationType, IFormatProvider ^ formatProvider, bool ignoreCase);
public virtual object ConvertFrom (System.Management.Automation.PSObject sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase);
abstract member ConvertFrom : System.Management.Automation.PSObject * Type * IFormatProvider * bool -> obj
override this.ConvertFrom : System.Management.Automation.PSObject * Type * IFormatProvider * bool -> obj
Public Overridable Function ConvertFrom (sourceValue As PSObject, destinationType As Type, formatProvider As IFormatProvider, ignoreCase As Boolean) As Object
Parameters
- sourceValue
- PSObject
Value supposedly not of the types supported by this converted to be converted to the destinationType
parameter.
- destinationType
- Type
One of the types supported by this converter to which the sourceValue
parameter should be converted to.
- formatProvider
- IFormatProvider
The format provider to use like in IFormattable's ToString.
- ignoreCase
- Boolean
True if case should be ignored.
Returns
The sourceValue
parameter converted to the destinationType
parameter using formatProvider and ignoreCase.
Exceptions
If no conversion was possible.
Applies to
ConvertFrom(Object, Type, IFormatProvider, Boolean)
Converts the sourceValue
parameter to the destinationType
parameter using formatProvider and ignoreCase.
public:
abstract System::Object ^ ConvertFrom(System::Object ^ sourceValue, Type ^ destinationType, IFormatProvider ^ formatProvider, bool ignoreCase);
public abstract object ConvertFrom (object sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase);
abstract member ConvertFrom : obj * Type * IFormatProvider * bool -> obj
Public MustOverride Function ConvertFrom (sourceValue As Object, destinationType As Type, formatProvider As IFormatProvider, ignoreCase As Boolean) As Object
Parameters
- sourceValue
- Object
Value supposedly not of the types supported by this converted to be converted to the destinationType
parameter.
- destinationType
- Type
One of the types supported by this converter to which the sourceValue
parameter should be converted to.
- formatProvider
- IFormatProvider
The format provider to use like in IFormattable's ToString.
- ignoreCase
- Boolean
True if case should be ignored.
Returns
The sourceValue
parameter converted to the destinationType
parameter using formatProvider and ignoreCase.
Exceptions
If no conversion was possible.