Collections:
Other Resources:
"Receive-Job" Cmdlet in Windows PowerShell
How to use "Receive-Job" cmdlet in Windows PowerShell?
✍: FYIcenter.com
You can use the "Receive-Job" cmdlet to receive output result from an existing background job
by using the "-id n" or "-name xxx" to specify the background job.
The Receive-Job cmdlet gets the results that have been generated by the time that the Receive-Job command is submitted. If the results are not yet complete, you can run additional 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 save the results so that you can receive them again. To delete the job results, run the Receive-Job command again (without the Keep parameter), close the session, or use the Remove-Job cmdlet to delete the job from the session.
Here is an example of using the "Receive-Job" cmdlet to receive the output of an existing backgroundjob:
PS C:\fyicenter> start-job {get-process}
Id Name PSJobTypeName State HasMoreData Command
-- ---- ------------- ----- ----------- -------
2 Job2 BackgroundJob Running True get-process
PS C:\fyicenter> receive-job -id 2 -keep
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
2155 9 4964 724 92 19.78 4472 AdobeARM
135 5 4264 220 57 1.56 4044 cmd
161 8 26516 2232 74 1.65 3140 CmRcService
51 3 1368 1052 46 4.29 1760 conhost
52 3 1880 1128 46 3.39 4808 conhost
...
PS C:\fyicenter> receive-job -id 2 -keep
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
2155 9 4964 724 92 19.78 4472 AdobeARM
135 5 4264 220 57 1.56 4044 cmd
161 8 26516 2232 74 1.65 3140 CmRcService
51 3 1368 1052 46 4.29 1760 conhost
52 3 1880 1128 46 3.39 4808 conhost
...
Note that the "-keep" option keeps the out in the background job, instead of deleting it.
⇒ "Stop-Job" Cmdlet in Windows PowerShell
⇐ "Get-Job" Cmdlet in Windows PowerShell
2016-10-08, ∼3082🔥, 0💬
Popular Posts:
Can I disable Windows service "ASP.NET State Service" to speedup my computer? Windows service "ASP.N...
What is "Lenovo Camera Mute" in a service on Lenovo laptop computer that supports the camera on/off ...
What is PIM? What is a PIM Item, What is PIM Item Transfer? What is PIM? PIM stands for Personal Inf...
What is "Human Interface Device Access" in my Windows XP service list? And how is "Human Interface D...
How can I get detailed system information from my Windows Server 2012? A quick way to get detailed i...