Contact Info

Crumbtrail » Administration » Powershell » Powershell 2.0 » Receive-Job

Receive-Job - Powershell 2.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 »


Short description
Gets the results of the Windows PowerShell background jobs in the current session.

Receive-Job [-Job] <Job[]> [[-ComputerName] <string[]>] [-Keep] [-NoRecurse] [<CommonParameters>]

Receive-Job [[-InstanceId] <Guid[]>] [-Keep] [-NoRecurse] [<CommonParameters>]

Receive-Job [-Job] <Job[]> [[-Location] <string[]>] [-Keep] [-NoRecurse] [<CommonParameters>]

Receive-Job [[-Name] <string[]>] [-Keep] [-NoRecurse] [<CommonParameters>]

Receive-Job [-Job] <Job[]> [[-Session] <PSSession[]>] [-Keep] [-NoRecurse] [<CommonParameters>]

Receive-Job [-Id] <Int32[]> [-Keep] [-NoRecurse] [<CommonParameters>]

The Receive-Job cmdlet gets the results of Windows Powershell background jobs. Use Receive-Job to get the results o
f jobs started by using the Start-Job cmdlet or the AsJob parameter of any cmdlet. You can get the results of all j
obs or identify jobs by their name, ID, instance ID, computer name, location, or session, or by submitting a job ob

When you start a Windows PowerShell background job, the job starts, but the results do not appear immediately. Inst
ead, the command returns an object that represents the background job. The job object contains useful information a
bout the job, but it does not contain the results. This method allows you to continue working in the session while 
the job runs.  For more information about background jobs in Windows PowerShell, see about_Jobs.

To get the results of the command, use the Receive-Job cmdlet. Receive-Job gets the results that have been generate
d by the time that the Receive-Job command is submitted. If the results are not yet complete, you can run additiona
l Receive-Job commands to get the remaining results. 

By default, job results are deleted from the system when you receive them, but you can use the Keep parameter to sa
ve the results so that you can receive them again. To delete the job results, receive them again (without the Keep 
parameter), close the session, or use the Remove-Job cmdlet to delete the job from the session.