ArgumentTransformationAttribute Class
Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation)
[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field)] public abstract class ArgumentTransformationAttribute : CmdletMetadataAttribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field) */ public abstract class ArgumentTransformationAttribute extends CmdletMetadataAttribute
Argument transformation attributes can be attached to Cmdlet and CmdletProvider class parameters to automatically transform the argument value in some way. The transformation might change the object, convert the type, or even load a file or Active Directory object, based on its name.
Snap-ins that implement custom argument transformation attributes should derive from the ArgumentTransformationAttribute class and override the Transform abstract method, after which they can apply the attribute to their parameters.
It is also recommended to override the ToString method to return a readable string that is similar to the attribute declaration. For example, for the ValidateRangeAttribute attribute, the string "[ValidateRangeAttribute(5,10)]" could be returned.
If multiple transformations are defined on a parameter, they will be invoked in a series, each getting the output of the previous transformation.
System.Attribute
System.Management.Automation.Internal.CmdletMetadataAttribute
System.Management.Automation.ArgumentTransformationAttribute
System.Management.Automation.CredentialAttribute
Target Platforms
Windows Developer Preview, Windows Server Developer PreviewSend comments about this topic to Microsoft.