Updated: April 27, 2016
Applies To: Windows PowerShell
Serves as a base class for attributes that perform argument transformations.
Assembly: System.Management.Automation (in System.Management.Automation.dll)
Transforms the argument of a parameter into some other object that is used for the parameter value.
|_Attribute::GetIDsOfNames(Guid%, IntPtr, UInt32, UInt32, IntPtr)|
|_Attribute::GetTypeInfo(UInt32, UInt32, IntPtr)|
|_Attribute::Invoke(UInt32, Guid%, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)|
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 Transform abstract method, after which they can apply the attribute to their parameters.class and override the
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.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.