Freigeben über


ScheduledJob Class

Definition

This is a Job2 derived class that contains a DefinitionJob for running job definition based jobs but can also save and load job results data from file. This class is used to load job result data from previously run jobs so that a user can view results of scheduled job runs. This class also contains the defintion of the scheduled job and so can run an instance of the scheduled job and optionally save results to file.

[System.Serializable]
public sealed class ScheduledJob : System.Management.Automation.Job2, System.Runtime.Serialization.ISerializable
[<System.Serializable>]
type ScheduledJob = class
    inherit Job2
    interface ISerializable
Public NotInheritable Class ScheduledJob
Inherits Job2
Implements ISerializable
Inheritance
ScheduledJob
Attributes
Implements

Constructors

ScheduledJob(String, String, ScheduledJobDefinition)

Constructor.

Properties

ChildJobs

List of child jobs contained within this job.

(Inherited from Job)
Command

Job command string.

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)
Definition

ScheduledJobDefinition.

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 whether more data is available from Job.

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

Location of job being run.

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)
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

Status Message associated with the Job.

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)
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)
GetObjectData(SerializationInfo, StreamingContext)

Serialize method.

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)
ResumeJob()

ResumeJob.

ResumeJobAsync()

ResumeJobAsync.

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)
SetJobState(JobState)

Sets Job State.

(Inherited from Job)
StartJob()

Starts a job as defined by the contained ScheduledJobDefinition object.

StartJobAsync()

Start job asynchronously.

StopJob()

Stop the job.

StopJob(Boolean, String)

StopJob

StopJobAsync()

Stop the job asynchronously.

StopJobAsync(Boolean, String)

StopJobAsync

SuspendJob()

SuspendJob.

SuspendJob(Boolean, String)

SuspendJob

SuspendJobAsync()

SuspendJobAsync.

SuspendJobAsync(Boolean, String)

SuspendJobAsync

UnblockJob()

UnblockJob.

UnblockJobAsync()

UnblockJobAsync.

UnloadJobStreams()

Unload the required job streams.

(Inherited from Job)

Events

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