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 sealed class PSJobProxy : System.Management.Automation.Job2
Inheritance
PSJobProxy

Inherited Members

System.Management.Automation.Job

System.Management.Automation.Job2

Properties

HasMoreData

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

Location

This is the location string from the remote 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

StatusMessage

Success status of the command execution.

Methods

Create(Runspace)

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(Runspace, Hashtable)

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(Runspace, Hashtable, Boolean)

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(Runspace, Hashtable, EventHandler<JobDataAddedEventArgs>, EventHandler<JobStateEventArgs>)

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.

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.

StartJob()

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

StartJob(PSDataCollection<Object>)

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

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.

StartJobAsync()

Start a job asynchronously

StartJobAsync(PSDataCollection<Object>)

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

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.

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

Events

RemoveJobCompleted

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