Windows desktop applications
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Cmdlet Class

Serves as a base class for derived cmdlets that do not depend on the Windows PowerShell runtime and that can be called directly from within another cmdlet.

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

Dim instance As Cmdlet

public abstract class Cmdlet : InternalCommand
public abstract class Cmdlet extends InternalCommand
public abstract class Cmdlet extends InternalCommand

Deriving from this class means that your cmdlet is using the minimum set of dependencies on the Windows PowerShell runtime. This has two benefits. First, your cmdlet objects are smaller and you are less likely to be affected by changes to the Windows PowerShell runtime. Second, if you have to, you can create an instance of the cmdlet object and invoke it directly instead of invoking it through the Windows PowerShell runtime.

Classes that derive from Cmdlet must also declare the cmdlet attribute to identify themselves as a Windows PowerShell cmdlet class. For more information about the guidelines for writing cmdlets, see Cmdlet Development Guidelines.

This class provides the following virtual methods that are called by the runtime. Cmdlets must override at least one of these methods to process records. In this SDK, these methods are often referred to as the input processing methods.

Cmdlets can also be derived from the PSCmdlet class. Deriving from this class provides access to the Windows PowerShell runtime. For more information about the differences between cmdlets based on the two base cmdlet classes, see Windows PowerShell Cmdlets.

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

© 2016 Microsoft