Freigeben über


SessionBasedCmdletAdapter<TObjectInstance,TSession> Class

Definition

Provides common code for processing session-based object models. The common code Session, ThrottleLimit, AsJob parameters and delegates creation of jobs to derived classes.

generic <typename TObjectInstance, typename TSession>
 where TObjectInstance : class where TSession : classpublic ref class SessionBasedCmdletAdapter abstract : Microsoft::PowerShell::Cmdletization::CmdletAdapter<TObjectInstance>, IDisposable
public abstract class SessionBasedCmdletAdapter<TObjectInstance,TSession> : Microsoft.PowerShell.Cmdletization.CmdletAdapter<TObjectInstance>, IDisposable where TObjectInstance : class where TSession : class
type SessionBasedCmdletAdapter<'ObjectInstance, 'Session (requires 'ObjectInstance : null and 'Session : null)> = class
    inherit CmdletAdapter<'ObjectInstance (requires 'ObjectInstance : null)>
    interface IDisposable
Public MustInherit Class SessionBasedCmdletAdapter(Of TObjectInstance, TSession)
Inherits CmdletAdapter(Of TObjectInstance)
Implements IDisposable

Type Parameters

TObjectInstance

Type that represents instances of objects from the wrapped object model

TSession

Type representing remote sessions

Inheritance
SessionBasedCmdletAdapter<TObjectInstance,TSession>
Derived
Implements

Properties

AsJob

Whether to wrap and emit the whole operation as a background job.

ClassName

Name of the class (from the object model handled by this ObjectModelWrapper) that is wrapped by the currently executing cmdlet.

(Inherited from CmdletAdapter<TObjectInstance>)
ClassVersion

Name of the class (from the object model handled by this ObjectModelWrapper) that is wrapped by the currently executing cmdlet. This value can be null (i.e. when ClassVersion attribute is omitted in the ps1xml)

(Inherited from CmdletAdapter<TObjectInstance>)
Cmdlet

Cmdlet that this ObjectModelWrapper is associated with.

(Inherited from CmdletAdapter<TObjectInstance>)
DefaultSession

Returns default sessions to use when the user doesn't specify the -Session cmdlet parameter.

ModuleVersion

Module version.

(Inherited from CmdletAdapter<TObjectInstance>)
PrivateData

Private data from Cmdlet Definition XML (from <ObjectModelWrapperPrivateData> element)

(Inherited from CmdletAdapter<TObjectInstance>)
Session

Session to operate on.

ThrottleLimit

Maximum number of remote connections that can remain active at any given time.

Methods

BeginProcessing()

Performs initialization of cmdlet execution.

Dispose()

Releases resources associated with this object.

Dispose(Boolean)

Releases resources associated with this object.

EndProcessing()

Performs cleanup after cmdlet execution.

GenerateParentJobName()

A new job name to use for the parent job that handles throttling of the child jobs that actually perform querying and method invocation.

GetQueryBuilder()

When overridden in the derived class, creates a query builder for a given object model.

(Inherited from CmdletAdapter<TObjectInstance>)
Initialize(PSCmdlet, String, String, Version, IDictionary<String,String>)

Class constructor.

(Inherited from CmdletAdapter<TObjectInstance>)
ProcessRecord(MethodInvocationInfo)

Invokes a static method in the object model.

ProcessRecord(QueryBuilder)

Queries for object instances in the object model.

ProcessRecord(QueryBuilder, MethodInvocationInfo, Boolean)

Queries for instance and invokes an instance method.

ProcessRecord(TObjectInstance, MethodInvocationInfo, Boolean)

Invokes an instance method in the object model.

StopProcessing()

Stops the parent job when called.

Applies to