PSJobProxy Class

Definition

Class that will serve as the API for hosting and executing workflows in PowerShell. This class will have a behavior similar to how the Runspace and PowerShell APIs behave in the remoting scenario. The objects on the client side act as proxies to the real objects on the server

public ref class PSJobProxy sealed : System::Management::Automation::Job2
public sealed class PSJobProxy : System.Management.Automation.Job2
type PSJobProxy = class
    inherit Job2
Public NotInheritable Class PSJobProxy
Inherits Job2
Inheritance
PSJobProxy

Properties

ChildJobs

List of child jobs contained within this job.

(Inherited from Job)
Command

Command Invoked by this Job.

(Inherited from Job)
Debug

Gets or sets the debug buffer. Debug output of Job is written to this buffer. Cannot set to a null value.

(Inherited from Job)
Error

Gets or sets the error buffer. Errors of job are written into this buffer.

(Inherited from Job)
Finished

Wait Handle which is signaled when job is finished. This is set when state of the job is set to Completed, Stopped or Failed.

(Inherited from Job)
HasMoreData

Indicates that more data is available in this result object for reading.

Id

Short identifier for this result which will be recycled and used within a process.

(Inherited from Job)
Information

Gets or sets the information buffer. Information records of job are written to this buffer.

(Inherited from Job)
InstanceId

Unique identifier for this job.

(Inherited from Job)
JobStateInfo

Status of the command execution.

(Inherited from Job)
Location

This is the location string from the remote job.

Name

Name for identifying this job object.

(Inherited from Job)
Output

Gets or sets the output buffer. Output of job is written into this buffer.

(Inherited from Job)
Progress

Gets or sets the progress buffer. Progress of job is written into this buffer.

(Inherited from Job)
PSBeginTime

Time job was started.

(Inherited from Job)
PSEndTime

Time job stopped.

(Inherited from Job)
PSJobTypeName

Job type name.

(Inherited from Job)
RemoteJobInstanceId

The instance ID of the remote job that this proxy interacts with.

RemoveRemoteJobOnCompletion

If set, the remote job will be removed when it has been completed and the data has been received. This can only be set prior to a job being started.

Runspace

Runspace in which this job will be executed

RunspacePool

RunspacePool in which this job will be executed

StartParameters

Parameters to be used to start a job. This is a property because CommandParameterCollection does not have a public constructor. Hence the infrastructure creates an instance and provides it for the implementations to use.

(Inherited from Job2)
StatusMessage

Success status of the command execution.

SyncRoot (Inherited from Job2)
Verbose

Gets or sets the verbose buffer. Verbose output of job is written to this stream.

(Inherited from Job)
Warning

Gets or sets the warning buffer. Warnings of job are written to this buffer.

(Inherited from Job)

Methods

AutoGenerateJobName()

Automatically generate a job name if the user does not supply one.

(Inherited from Job)
Create(Runspace)

Queries the runspace for jobs and constructs a collection of job proxies to interact with them.

Create(Runspace, Hashtable)

Queries the runspace for jobs and constructs a collection of job proxies to interact with them.

Create(Runspace, Hashtable, Boolean)

Queries the runspace for jobs and constructs a collection of job proxies to interact with them.

Create(Runspace, Hashtable, EventHandler<JobDataAddedEventArgs>, EventHandler<JobStateEventArgs>)

Queries the runspace for jobs and constructs a collection of job proxies to interact with them.

Create(RunspacePool)

Queries the runspace for jobs and constructs a collection of job proxies to interact with them.

Create(RunspacePool, Hashtable)

Queries the runspace for jobs and constructs a collection of job proxies to interact with them.

Create(RunspacePool, Hashtable, Boolean)

Queries the runspace for jobs and constructs a collection of job proxies to interact with them.

Create(RunspacePool, Hashtable, EventHandler<JobDataAddedEventArgs>, EventHandler<JobStateEventArgs>)

Queries the runspace for jobs and constructs a collection of job proxies to interact with them.

Dispose()

Dispose all managed resources. This will suppress finalizer on the object from getting called by calling System.GC.SuppressFinalize(this).

(Inherited from Job)
Dispose(Boolean)

Release all the resources.

(Inherited from Job)
DoLoadJobStreams()

This method is introduce for delaying the loading of streams for a particular job.

(Inherited from Job)
DoUnloadJobStreams()

Unloads job streams information. Enables jobs to clear stream information from memory.

(Inherited from Job)
LoadJobStreams()

Load the required job streams.

(Inherited from Job)
OnResumeJobCompleted(AsyncCompletedEventArgs)

Method which can be extended or called by derived classes to raise the event when resuming a suspended job is completed.

(Inherited from Job2)
OnStartJobCompleted(AsyncCompletedEventArgs)

Method which can be extended or called by derived classes to raise the event when start of the job is completed.

(Inherited from Job2)
OnStopJobCompleted(AsyncCompletedEventArgs)

Method which can be extended or called by derived classes to raise the event when stopping a job is completed.

(Inherited from Job2)
OnSuspendJobCompleted(AsyncCompletedEventArgs)

Method which can be extended or called by derived classes to raise the event when suspending a job is completed.

(Inherited from Job2)
OnUnblockJobCompleted(AsyncCompletedEventArgs)

Method which can be extended or called by derived classes to raise the event when unblocking a blocked job is completed.

(Inherited from Job2)
ReceiveJob()

Will begin streaming data for a job object created by the "create" method that is in a not started state.

ReceiveJob(EventHandler<JobDataAddedEventArgs>, EventHandler<JobStateEventArgs>)

Will begin streaming data for a job object created by the "create" method that is in a not started state.

RemoveJob(Boolean)

Removes the job. If remoteJob is true, the job output that has been transferred to this client object will be preserved.

RemoveJob(Boolean, Boolean)

Removes the job. If remoteJob is true, the job output that has been transferred to this client object will be preserved.

RemoveJobAsync(Boolean)

Removes the job on the remote server. The job output that has been transferred to this client object will be preserved.

RemoveJobAsync(Boolean, Boolean)

Removes the job on the remote server. The job output that has been transferred to this client object will be preserved.

ResumeJob()

Resume a suspended job

ResumeJobAsync()

Resume a suspended job asynchronously.

SetJobState(JobState)

Sets Job State.

(Inherited from Job)
SetJobState(JobState, Exception)

There is an internal method in Job which is not made public. In order to make this available to someone implementing a job it has to be added here. If the original method is made public it has changes of colliding with some implementation which may have added that method.

(Inherited from Job2)
StartJob()

start a job. The job will be started with the parameters specified in StartParameters

StartJob(EventHandler<JobDataAddedEventArgs>, EventHandler<JobStateEventArgs>, PSDataCollection<Object>)

Start execution of the workflow with the specified input. This input will serve as input to the underlying pipeline. Because the number of child jobs is unknown before starting the job, delegates may be indicated to ensure that no events will be missed after the child job is created if data begins streaming back immediately.

StartJob(PSDataCollection<Object>)

Start execution of the job with the specified input. This input will serve as input to the underlying pipeline

StartJobAsync()

Start a job asynchronously

StartJobAsync(EventHandler<JobDataAddedEventArgs>, EventHandler<JobStateEventArgs>, PSDataCollection<Object>)

Start asynchronous execution of the workflow with the specified input. This input will serve as input to the underlying pipeline. Because the number of child jobs is unknown before starting the job, delegates may be indicated to ensure that no events will be missed after the child job is created if data begins streaming back immediately.

StartJobAsync(PSDataCollection<Object>)

Start execution of the workflow with the specified input. This input will serve as input to the underlying pipeline

StopJob()

Stop a job synchronously. In order to be consistent, this method should be used in place of StopJob which was introduced in the v2 Job API

StopJob(Boolean, String)

StopJob

StopJobAsync()

Stop a job asynchronously

StopJobAsync(Boolean, String)

StopJobAsync

SuspendJob()

Suspend a job

SuspendJob(Boolean, String)

SuspendJob

SuspendJobAsync()

Asynchronously suspend a job

SuspendJobAsync(Boolean, String)

SuspendJobAsync

UnblockJob()

Unblock a blocked job

UnblockJobAsync()

Unblock a blocked job asynchronously

UnloadJobStreams()

Unload the required job streams.

(Inherited from Job)

Events

RemoveJobCompleted

This event should be raised whenever the asynchronous removal of a server side job is completed.

ResumeJobCompleted

This event should be raised whenever the asynchronous resume of a suspended job is completed. This event should not be raised for synchronous operation.

(Inherited from Job2)
StartJobCompleted

Event to be raise when the start job activity is completed. This event should not be raised for synchronous operation.

(Inherited from Job2)
StateChanged

Event raised when state of the job changes.

(Inherited from Job)
StopJobCompleted

Event to be raised when the asynchronous stopping of a job is completed.This event should not be raised for synchronous operation.

(Inherited from Job2)
SuspendJobCompleted

This event should be raised whenever the asynchronous suspend of a job is completed. This event should not be raised for synchronous operation.

(Inherited from Job2)
UnblockJobCompleted

This event should be raised whenever the asynchronous unblock of a blocked job is completed. This event should not be raised for synchronous operation.

(Inherited from Job2)

Applies to