Export (0) Print
Expand All

PSCmdlet Class

Serves as a base class for derived cmdlets that depend on access to the Windows PowerShell runtime, and therefore execute within a runspace.


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

'Usage
Dim instance As PSCmdlet

public ref class PSCmdlet abstract : public Cmdlet
public abstract class PSCmdlet extends Cmdlet
public abstract class PSCmdlet extends Cmdlet

Deriving from this class gives you much more access to the Windows PowerShell runtime. This access allows your cmdlet to call scripts, access providers, and access the current session state (getting and setting session variables and preferences). However, it also increases the size of the cmdlet object, and it means that your cmdlet is more tightly coupled to the current version of the Windows PowerShell runtime.

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

Cmdlets must override at least one of these methods (inherited from the Cmdlet class) in order to process records. In this SDK, these methods are often referred to as the input processing methods.

Cmdlets may also be derived from the Cmdlet class. Deriving from this class means that your cmdlet is using the minimum set of dependencies on the Windows PowerShell runtime. For more information about about the differences between cmdlets based on the two base 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

Windows Developer Preview, Windows Server Developer Preview

Send comments about this topic to Microsoft.
Show:
© 2014 Microsoft