Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

PSTypeConverter Class

Defines a base class that is used to implement a type converter for a specific target class.


Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)

'Usage
Dim instance As PSTypeConverter

public abstract class PSTypeConverter
public abstract class PSTypeConverter
public abstract class PSTypeConverter

A Windows PowerShell type converter is needed when Windows PowerShell cannot perform a type conversion for a specific target class by using the standard Windows PowerShell language converters. For more information about the standard Windows PowerShell language converters and the Windows PowerShell type converter, see ETS Type Conversion.

There are two ways of associating the implementation of the PSTypeConverter class with its target class:

Classes that derive from PSTypeConverter differ from classes that derive from TypeConverter in the following ways:

  • Classes that derive from PSTypeConverter can be applied to a family of types (such as all types derived from the Enum class). Classes derived from TypeConverter can be applied to only one type.

    This is done by inspecting the destinationType parameter of the PSTypeConverter and CanConvertFrom methods to see which member of a family type is specified in the sourceValue parameter.

  • The ConvertTo and ConvertFrom methods have formatProvider and ignoreCase parameters for customizing the conversion.

  • The PSTypeConverter class has no ITypeDescriptorContext interface.

  • The PSTypeConverter class is an abstract class.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

 

Target Platforms


Show:
© 2015 Microsoft