Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Job Class

 

Updated: April 27, 2016

Applies To: Windows PowerShell

Serves as a base class for objects that represents a background job. A background job runs a command that can contain a command or expression. The job is run asynchronously within its own runspace. This class is introduced in Windows PowerShell 2.0.

Namespace:   System.Management.Automation
Assembly:  System.Management.Automation (in System.Management.Automation.dll)


public abstract class Job : IDisposable

NameDescription
System_CAPS_protmethodJob()

Creates a new Job object that is empty. This constructor is introduced by Windows PowerShell 2.0.

System_CAPS_protmethodJob(String)

Creates a new Job object that contains the command to be run. This constructor is introduced by Windows PowerShell 2.0.

System_CAPS_protmethodJob(String, String)

Creates a new Job object that contains the command to be run and the name of the job. This constructor is introduced by Windows PowerShell 2.0.

System_CAPS_protmethodJob(String, String, Guid)

Initializes a new instance of the Job class that contains the command to be run, the name of the job, and the instance. Introduced in Windows PowerShell 3.0.

System_CAPS_protmethodJob(String, String, IList<Job>)

Creates a new Job object that contains the command to be run, the name of the job, and any child jobs. This constructor is introduced by Windows PowerShell 2.0.

System_CAPS_protmethodJob(String, String, JobIdentifier)

Initializes a new instance of the Job class that contains the command to be run, the name of the job, and the job identifier. Introduced in Windows PowerShell 3.0.

NameDescription
System_CAPS_pubpropertyChildJobs

Gets a list of the child jobs included in this job. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyCommand

Gets the command that is run by this job. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyDebug

Gets and sets the buffer where debug information is stored. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyError

Gets and sets the buffer where error information is stored. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyFinished

Gets the wait handle that is signaled when job is finished. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyHasMoreData

Gets a Boolean value that indicates whether more data is available. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyId

Gets the identifier of the job. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyInformation

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

System_CAPS_pubpropertyInstanceId

Gets the identifier of this instance of the job. The instance identifier of the job is unique throughout all runspaces. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyJobStateInfo

Gets the status of the job. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyLocation

Gets the location of where the job is running. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyName

Gets and sets the name that can be used to identify the job. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyOutput

Gets and sets the output buffer for the job. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyProgress

Gets and sets the progress buffer for the job. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyPSBeginTime

Gets or sets when to begin the job. Introduced in Windows PowerShell 3.0.

System_CAPS_pubpropertyPSEndTime

Gets or sets when to end the job. Introduced in Windows PowerShell 3.0.

System_CAPS_pubpropertyPSJobTypeName

Gets or sets the job type name. Introduced in Windows PowerShell 3.0.

System_CAPS_pubpropertyStatusMessage

Gets the status message when the job is successful. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyVerbose

Gets and sets the verbose buffer for the job. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyWarning

Gets and sets the warning buffer for the job. This property is introduced in Windows PowerShell 2.0.

NameDescription
System_CAPS_protmethodAutoGenerateJobName()

Automatically adds the specified job name if the user does not supply one when creating the job. This method is introduced in Windows PowerShell 2.0.

System_CAPS_pubmethodDispose()

Releases the resources used by the Job object. This method is introduced in Windows PowerShell 2.0.

System_CAPS_protmethodDispose(Boolean)

Releases the resources used by the Job object. This method is introduced in Windows PowerShell 2.0.

System_CAPS_protmethodDoLoadJobStreams()

Specifies the loading of the streams for a particular job. Introduced in Windows PowerShell 3.0.

System_CAPS_protmethodDoUnloadJobStreams()

Unloads job stream information, which enables jobs to clear stream information from memory. Introduced in Windows PowerShell 3.0.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodLoadJobStreams()

Loads the required job streams. Introduced in Windows PowerShell 3.0.

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethodSetJobState(JobState)

Sets the status of the job, such as is it running, has it completed, or has it failed. This method is introduced in Windows PowerShell 2.0.

System_CAPS_pubmethodStopJob()

Stops the job in all runspaces. This method is introduced in Windows PowerShell 2.0.

System_CAPS_pubmethodToString()

(Inherited from Object.)

System_CAPS_pubmethodUnloadJobStreams()

Unloads the required job streams. Introduced in Windows PowerShell 3.0.

NameDescription
System_CAPS_pubeventStateChanged

Event fired when the status of the job changes, such as when the job has completed in all runspaces or failed in any one runspace. This event is introduced in Windows PowerShell 2.0.

The command run by the job can contain cmdlets, functions, scripts, or any other command-based tasks. It is designed to run commands that take an extended amount of time to complete, but it can run any command in the background.

Jobs are executed within their own runspaces, and those runspaces can exist on the local computer or any number of remote computers. See the ChildJobs property for more information about jobs that run on multiple runspaces.

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top

Community Additions

Show: