PSJobProxy PSJobProxy 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
type PSJobProxy = class
    inherit Job2
Public NotInheritable Class PSJobProxy
Inherits Job2
Inheritance
PSJobProxyPSJobProxyPSJobProxy

Properties

ChildJobs ChildJobs ChildJobs Inherited from Job
Command Command Command Inherited from Job
Debug Debug Debug Inherited from Job
Error Error Error Inherited from Job
Finished Finished Finished Inherited from Job
HasMoreData HasMoreData HasMoreData

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

Id Id Id Inherited from Job
Information Information Information Inherited from Job
InstanceId InstanceId InstanceId Inherited from Job
JobStateInfo JobStateInfo JobStateInfo Inherited from Job
Location Location Location

This is the location string from the remote job.

Name Name Name Inherited from Job
Output Output Output Inherited from Job
PSBeginTime PSBeginTime PSBeginTime Inherited from Job
PSEndTime PSEndTime PSEndTime Inherited from Job
PSJobTypeName PSJobTypeName PSJobTypeName Inherited from Job
Progress Progress Progress Inherited from Job
RemoteJobInstanceId RemoteJobInstanceId RemoteJobInstanceId

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

RemoveRemoteJobOnCompletion RemoveRemoteJobOnCompletion 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 Runspace

Runspace in which this job will be executed

RunspacePool RunspacePool RunspacePool

RunspacePool in which this job will be executed

StartParameters StartParameters StartParameters Inherited from Job2
StatusMessage StatusMessage StatusMessage

Success status of the command execution.

SyncRoot SyncRoot SyncRoot Inherited from Job2
Verbose Verbose Verbose Inherited from Job
Warning Warning Warning Inherited from Job

Methods

AutoGenerateJobName() AutoGenerateJobName() AutoGenerateJobName() Inherited from Job
Create(Runspace) Create(Runspace) Create(Runspace)

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

Create(Runspace, Hashtable) Create(Runspace, Hashtable) Create(Runspace, Hashtable)

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

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

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

Create(RunspacePool, Hashtable) Create(RunspacePool, Hashtable) Create(RunspacePool, Hashtable)

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

Create(RunspacePool, Hashtable, Boolean) Create(RunspacePool, Hashtable, Boolean) 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>) Create(RunspacePool, Hashtable, EventHandler<JobDataAddedEventArgs>, EventHandler<JobStateEventArgs>) 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() Dispose() Inherited from Job
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Inherited from Job
DoLoadJobStreams() DoLoadJobStreams() DoLoadJobStreams() Inherited from Job
DoUnloadJobStreams() DoUnloadJobStreams() DoUnloadJobStreams() Inherited from Job
LoadJobStreams() LoadJobStreams() LoadJobStreams() Inherited from Job
OnResumeJobCompleted(AsyncCompletedEventArgs) OnResumeJobCompleted(AsyncCompletedEventArgs) OnResumeJobCompleted(AsyncCompletedEventArgs) Inherited from Job2
OnStartJobCompleted(AsyncCompletedEventArgs) OnStartJobCompleted(AsyncCompletedEventArgs) OnStartJobCompleted(AsyncCompletedEventArgs) Inherited from Job2
OnStopJobCompleted(AsyncCompletedEventArgs) OnStopJobCompleted(AsyncCompletedEventArgs) OnStopJobCompleted(AsyncCompletedEventArgs) Inherited from Job2
OnSuspendJobCompleted(AsyncCompletedEventArgs) OnSuspendJobCompleted(AsyncCompletedEventArgs) OnSuspendJobCompleted(AsyncCompletedEventArgs) Inherited from Job2
OnUnblockJobCompleted(AsyncCompletedEventArgs) OnUnblockJobCompleted(AsyncCompletedEventArgs) OnUnblockJobCompleted(AsyncCompletedEventArgs) Inherited from Job2
ReceiveJob() ReceiveJob() 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>) ReceiveJob(EventHandler<JobDataAddedEventArgs>, EventHandler<JobStateEventArgs>) 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) RemoveJob(Boolean) 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) RemoveJob(Boolean, Boolean) 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) RemoveJobAsync(Boolean) 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) RemoveJobAsync(Boolean, Boolean) 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() ResumeJob() ResumeJob()

Resume a suspended job

ResumeJobAsync() ResumeJobAsync() ResumeJobAsync()

Resume a suspended job asynchronously.

SetJobState(JobState) SetJobState(JobState) SetJobState(JobState) Inherited from Job
SetJobState(JobState, Exception) SetJobState(JobState, Exception) SetJobState(JobState, Exception) Inherited from Job2
StartJob() StartJob() StartJob()

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

StartJob(EventHandler<JobDataAddedEventArgs>, EventHandler<JobStateEventArgs>, PSDataCollection<Object>) StartJob(EventHandler<JobDataAddedEventArgs>, EventHandler<JobStateEventArgs>, PSDataCollection<Object>) 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>) StartJob(PSDataCollection<Object>) StartJob(PSDataCollection<Object>)

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

StartJobAsync() StartJobAsync() StartJobAsync()

Start a job asynchronously

StartJobAsync(EventHandler<JobDataAddedEventArgs>, EventHandler<JobStateEventArgs>, PSDataCollection<Object>) StartJobAsync(EventHandler<JobDataAddedEventArgs>, EventHandler<JobStateEventArgs>, PSDataCollection<Object>) 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>) StartJobAsync(PSDataCollection<Object>) StartJobAsync(PSDataCollection<Object>)

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

StopJob() StopJob() 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(Boolean, String) StopJob(Boolean, String)

StopJob

StopJobAsync() StopJobAsync() StopJobAsync()

Stop a job asynchronously

StopJobAsync(Boolean, String) StopJobAsync(Boolean, String) StopJobAsync(Boolean, String)

StopJobAsync

SuspendJob() SuspendJob() SuspendJob()

Suspend a job

SuspendJob(Boolean, String) SuspendJob(Boolean, String) SuspendJob(Boolean, String)

SuspendJob

SuspendJobAsync() SuspendJobAsync() SuspendJobAsync()

Asynchronously suspend a job

SuspendJobAsync(Boolean, String) SuspendJobAsync(Boolean, String) SuspendJobAsync(Boolean, String)

SuspendJobAsync

UnblockJob() UnblockJob() UnblockJob()

Unblock a blocked job

UnblockJobAsync() UnblockJobAsync() UnblockJobAsync()

Unblock a blocked job asynchronously

UnloadJobStreams() UnloadJobStreams() UnloadJobStreams() Inherited from Job

Events

RemoveJobCompleted RemoveJobCompleted RemoveJobCompleted

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

ResumeJobCompleted ResumeJobCompleted ResumeJobCompleted Inherited from Job2
StartJobCompleted StartJobCompleted StartJobCompleted Inherited from Job2
StateChanged StateChanged StateChanged Inherited from Job
StopJobCompleted StopJobCompleted StopJobCompleted Inherited from Job2
SuspendJobCompleted SuspendJobCompleted SuspendJobCompleted Inherited from Job2
UnblockJobCompleted UnblockJobCompleted UnblockJobCompleted Inherited from Job2

Applies to