ConvertThroughString Class

Definition

Enables a type that only has conversion from string to be converted from all other types through string.

public ref class ConvertThroughString : System::Management::Automation::PSTypeConverter
public class ConvertThroughString : System.Management.Automation.PSTypeConverter
type ConvertThroughString = class
    inherit PSTypeConverter
Public Class ConvertThroughString
Inherits PSTypeConverter
Inheritance
ConvertThroughString

Remarks

It is permitted to subclass ConvertThroughString but there is no established scenario for doing this, nor has it been tested.

Constructors

ConvertThroughString()

Methods

CanConvertFrom(Object, Type)

This will return false only if sourceValue is string.

CanConvertFrom(PSObject, Type)

Determines if the converter can convert the sourceValue parameter to the destinationType parameter.

(Inherited from PSTypeConverter)
CanConvertTo(Object, Type)

Returns false, since this converter is not designed to be used to convert from the type associated with the converted to other types.

CanConvertTo(PSObject, Type)

Returns true if the converter can convert the sourceValue parameter to the destinationType parameter.

(Inherited from PSTypeConverter)
ConvertFrom(Object, Type, IFormatProvider, Boolean)

Converts to destinationType by first converting sourceValue to string and then converting the result to destinationType.

ConvertFrom(PSObject, Type, IFormatProvider, Boolean)

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

(Inherited from PSTypeConverter)
ConvertTo(Object, Type, IFormatProvider, Boolean)

Throws NotSupportedException, since this converter is not designed to be used to convert from the type associated with the converted to other types.

ConvertTo(PSObject, Type, IFormatProvider, Boolean)

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

(Inherited from PSTypeConverter)

Applies to