Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 3.0 » Get-Job

Get-Job - Powershell 3.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »

Get-Job

Short description
Gets Windows PowerShell background jobs that are running in the current session.

Syntax
Get-Job [[-Id] <Int32[]>] [-After <DateTime>] [-Before <DateTime>] [-ChildJobState <JobState>] [-HasMoreData <Boolean>]
 [-IncludeChildJob] [-Newest <Int32>] [<CommonParameters>]
Get-Job [-After <DateTime>] [-Before <DateTime>] [-ChildJobState <JobState>] [-Command <String[]>] [-HasMoreData <Boole
an>] [-IncludeChildJob] [-Newest <Int32>] [<CommonParameters>]
Get-Job [-Filter] <Hashtable> [<CommonParameters>]
Get-Job [-State] <JobState> [-After <DateTime>] [-Before <DateTime>] [-ChildJobState <JobState>] [-HasMoreData <Boolean
>] [-IncludeChildJob] [-Newest <Int32>] [<CommonParameters>]
Get-Job [-Name] <String[]> [-After <DateTime>] [-Before <DateTime>] [-ChildJobState <JobState>] [-HasMoreData <Boolean>
] [-IncludeChildJob] [-Newest <Int32>] [<CommonParameters>]
Get-Job [-InstanceId] <Guid[]> [-After <DateTime>] [-Before <DateTime>] [-ChildJobState <JobState>] [-HasMoreData <Bool
ean>] [-IncludeChildJob] [-Newest <Int32>] [<CommonParameters>]





Description
The Get-Job cmdlet gets objects that represent the background jobs that were started in the current session. You can us
e Get-Job to get jobs that were started by using the Start-Job cmdlet, or by using the AsJob parameter of any cmdlet.


Without parameters, a "Get-Job" command gets all jobs in the current session. You can use the parameters of Get-Job to 
get particular jobs.


The job object that Get-Job returns contains useful information about the job, but it does not contain the job results.
 To get the results, use the Receive-Job cmdlet.


A Windows PowerShell background job is a command that runs "in the background" without interacting with the current ses
sion. Typically, you use a background job to run a complex command that takes a long time to complete. For more informa
tion about background jobs in Windows PowerShell, see about_Jobs.


Beginning in Windows PowerShell 3.0, the Get-Job cmdlet also gets custom job types, such as workflow jobs and instances
 of scheduled jobs. To find the job type of a job, use the PSJobTypeName property of the job.


To enable Get-Job to get a custom job type, import the module that supports the custom job type into the session before
 running a Get-Job command, either by using the Import-Module cmdlet or by using or getting a cmdlet in the module. For
 information about a particular custom job type, see the documentation of the custom job type feature.