PSCmdlet PSCmdlet PSCmdlet Class

Definition

Defines members and overrides used by Cmdlets. All Cmdlets must derive from Cmdlet.

public abstract class PSCmdlet : System.Management.Automation.Cmdlet
type PSCmdlet = class
    inherit Cmdlet
Public MustInherit Class PSCmdlet
Inherits Cmdlet
Inheritance
Derived

Remarks

There are two ways to create a Cmdlet: by deriving from the Cmdlet base class, and by
deriving from the PSCmdlet base class.  The Cmdlet base class is the primary means by
which users create their own Cmdlets.  Extending this class provides support for the most
common functionality, including object output and record processing.
If your Cmdlet requires access to the MSH Runtime (for example, variables in the session state, 
access to the host, or information about the current Cmdlet Providers,) then you should instead 
derive from the PSCmdlet base class.  
The public members defined by the PSCmdlet class are not designed to be overridden; instead, they 
provided access to different aspects of the MSH runtime.
In both cases, users should first develop and implement an object model to accomplish their
task, extending the Cmdlet or PSCmdlet classes only as a thin management layer.

Constructors

PSCmdlet() PSCmdlet() PSCmdlet()

Initializes the new instance of PSCmdlet class.

Properties

CommandOrigin CommandOrigin CommandOrigin Inherited from InternalCommand
CommandRuntime CommandRuntime CommandRuntime Inherited from Cmdlet
CurrentPSTransaction CurrentPSTransaction CurrentPSTransaction Inherited from Cmdlet
Events Events Events

Gets the event manager for the current runspace.

Host Host Host

Gets the host interaction APIs.

InvokeCommand InvokeCommand InvokeCommand

Provides access to utility routines for executing scripts and creating script blocks.

InvokeProvider InvokeProvider InvokeProvider

Gets the instance of the provider interface APIs for the current runspace.

JobManager JobManager JobManager

Manager for JobSourceAdapters registered.

JobRepository JobRepository JobRepository

Repository for jobs

MyInvocation MyInvocation MyInvocation

Contains information about the identity of this cmdlet and how it was invoked.

PagingParameters PagingParameters PagingParameters

If the cmdlet declares paging support (via SupportsPaging), then PagingParameters property contains arguments of the paging parameters. Otherwise PagingParameters property is null.

ParameterSetName ParameterSetName ParameterSetName

The name of the parameter set in effect.

SessionState SessionState SessionState

Gets the instance of session state for the current runspace.

Stopping Stopping Stopping Inherited from Cmdlet

Methods

BeginProcessing() BeginProcessing() BeginProcessing() Inherited from Cmdlet
CurrentProviderLocation(String) CurrentProviderLocation(String) CurrentProviderLocation(String)
EndProcessing() EndProcessing() EndProcessing() Inherited from Cmdlet
GetResolvedProviderPathFromPSPath(String, ProviderInfo) GetResolvedProviderPathFromPSPath(String, ProviderInfo) GetResolvedProviderPathFromPSPath(String, ProviderInfo)
GetResourceString(String, String) GetResourceString(String, String) GetResourceString(String, String) Inherited from Cmdlet
GetUnresolvedProviderPathFromPSPath(String) GetUnresolvedProviderPathFromPSPath(String) GetUnresolvedProviderPathFromPSPath(String)
GetVariableValue(String) GetVariableValue(String) GetVariableValue(String)
GetVariableValue(String, Object) GetVariableValue(String, Object) GetVariableValue(String, Object)
Invoke() Invoke() Invoke() Inherited from Cmdlet
Invoke<T>() Invoke<T>() Invoke<T>() Inherited from Cmdlet
ProcessRecord() ProcessRecord() ProcessRecord() Inherited from Cmdlet
ShouldContinue(String, String) ShouldContinue(String, String) ShouldContinue(String, String) Inherited from Cmdlet
ShouldContinue(String, String, Boolean, Boolean) ShouldContinue(String, String, Boolean, Boolean) ShouldContinue(String, String, Boolean, Boolean) Inherited from Cmdlet
ShouldContinue(String, String, Boolean, Boolean, Boolean) ShouldContinue(String, String, Boolean, Boolean, Boolean) ShouldContinue(String, String, Boolean, Boolean, Boolean) Inherited from Cmdlet
ShouldProcess(String) ShouldProcess(String) ShouldProcess(String) Inherited from Cmdlet
ShouldProcess(String, String) ShouldProcess(String, String) ShouldProcess(String, String) Inherited from Cmdlet
ShouldProcess(String, String, String) ShouldProcess(String, String, String) ShouldProcess(String, String, String) Inherited from Cmdlet
ShouldProcess(String, String, String, ShouldProcessReason) ShouldProcess(String, String, String, ShouldProcessReason) ShouldProcess(String, String, String, ShouldProcessReason) Inherited from Cmdlet
StopProcessing() StopProcessing() StopProcessing() Inherited from Cmdlet
ThrowTerminatingError(ErrorRecord) ThrowTerminatingError(ErrorRecord) ThrowTerminatingError(ErrorRecord) Inherited from Cmdlet
TransactionAvailable() TransactionAvailable() TransactionAvailable() Inherited from Cmdlet
WriteCommandDetail(String) WriteCommandDetail(String) WriteCommandDetail(String) Inherited from Cmdlet
WriteDebug(String) WriteDebug(String) WriteDebug(String) Inherited from Cmdlet
WriteError(ErrorRecord) WriteError(ErrorRecord) WriteError(ErrorRecord) Inherited from Cmdlet
WriteInformation(InformationRecord) WriteInformation(InformationRecord) WriteInformation(InformationRecord) Inherited from Cmdlet
WriteInformation(Object, String[]) WriteInformation(Object, String[]) WriteInformation(Object, String[]) Inherited from Cmdlet
WriteObject(Object) WriteObject(Object) WriteObject(Object) Inherited from Cmdlet
WriteObject(Object, Boolean) WriteObject(Object, Boolean) WriteObject(Object, Boolean) Inherited from Cmdlet
WriteProgress(ProgressRecord) WriteProgress(ProgressRecord) WriteProgress(ProgressRecord) Inherited from Cmdlet
WriteVerbose(String) WriteVerbose(String) WriteVerbose(String) Inherited from Cmdlet
WriteWarning(String) WriteWarning(String) WriteWarning(String) Inherited from Cmdlet

Applies to