ConvertThroughString ConvertThroughString ConvertThroughString Class

Definition

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

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

Remarks

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

Constructors

ConvertThroughString() ConvertThroughString() ConvertThroughString()

Methods

CanConvertFrom(Object, Type) CanConvertFrom(Object, Type) CanConvertFrom(Object, Type)

This will return false only if sourceValue is string

CanConvertFrom(PSObject, Type) CanConvertFrom(PSObject, Type) CanConvertFrom(PSObject, Type) Inherited from PSTypeConverter
CanConvertTo(Object, Type) CanConvertTo(Object, Type) 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) CanConvertTo(PSObject, Type) CanConvertTo(PSObject, Type) Inherited from PSTypeConverter
ConvertFrom(Object, Type, IFormatProvider, Boolean) ConvertFrom(Object, Type, IFormatProvider, Boolean) 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) ConvertFrom(PSObject, Type, IFormatProvider, Boolean) ConvertFrom(PSObject, Type, IFormatProvider, Boolean) Inherited from PSTypeConverter
ConvertTo(Object, Type, IFormatProvider, Boolean) ConvertTo(Object, Type, IFormatProvider, Boolean) 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) ConvertTo(PSObject, Type, IFormatProvider, Boolean) ConvertTo(PSObject, Type, IFormatProvider, Boolean) Inherited from PSTypeConverter

Applies to