ArgumentTransformationAttribute Class

Definition

Serves as the base class for attributes that perform argument transformation.

[System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field)]
public abstract class ArgumentTransformationAttribute : System.Management.Automation.Internal.CmdletMetadataAttribute
Inheritance
ArgumentTransformationAttribute
Derived
Attributes

Remarks

Argument transformation attributes can be attached to Cmdlet and CmdletProvider parameters to automatically transform the argument value in some fashion. The transformation might change the object, convert the type, or even load a file or AD object based on the name. Existing argument transformation attributes include System.Management.Automation.ArgumentTypeConverterAttribute.

        PSSnapins wishing to create custom argument transformation attributes
        should derive from
        <seealso cref="T:System.Management.Automation.ArgumentTransformationAttribute"></seealso>
        and override the
        <seealso cref="M:System.Management.Automation.ArgumentTransformationAttribute.Transform(System.Management.Automation.EngineIntrinsics,System.Object)"></seealso>
        abstract method, after which they can apply the
        attribute to their parameters.

        It is also recommended to override
        <xref href="System.Object.ToString"></xref> to return a readable string
        similar to the attribute declaration, for example
        "[ValidateRangeAttribute(5,10)]".

        If multiple transformations are defined on a parameter,
        they will be invoked in series, each getting the output
        of the previous transformation.

Constructors

ArgumentTransformationAttribute()

Initializes a new instance of the ArgumentTransformationAttribute class

Properties

TransformNullOptionalParameters

Methods

Transform(EngineIntrinsics, Object)

Method that will be overridden by the subclasses to transform the inputData parameter argument into some other object that will be used for the parameter's value.