ArgumentTransformationAttribute ArgumentTransformationAttribute ArgumentTransformationAttribute ArgumentTransformationAttribute Class

Definition

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

public ref class ArgumentTransformationAttribute abstract : System::Management::Automation::Internal::CmdletMetadataAttribute
[System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field)]
public abstract class ArgumentTransformationAttribute : System.Management.Automation.Internal.CmdletMetadataAttribute
type ArgumentTransformationAttribute = class
    inherit CmdletMetadataAttribute
Public MustInherit Class ArgumentTransformationAttribute
Inherits CmdletMetadataAttribute
Inheritance
ArgumentTransformationAttributeArgumentTransformationAttributeArgumentTransformationAttributeArgumentTransformationAttribute
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 and override the abstract method, after which they can apply the attribute to their parameters.

It is also recommended to override ToString() 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() ArgumentTransformationAttribute() ArgumentTransformationAttribute() ArgumentTransformationAttribute()

Initializes a new instance of the ArgumentTransformationAttribute class

Properties

TransformNullOptionalParameters TransformNullOptionalParameters TransformNullOptionalParameters TransformNullOptionalParameters

The property is only checked when: a) The parameter is not mandatory b) The argument is null

Methods

Transform(EngineIntrinsics, Object) Transform(EngineIntrinsics, Object) Transform(EngineIntrinsics, Object) 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.

Applies to