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, 2279🔥, 0💬
Popular Posts:
product key for adding features to windows 8 The product key you require is MBFBV-W3DP2-2MVKN-PJCQD- ...
What is the scheduled task "\RTKCPL" on my Windows 7 computer? "\RTKCPL" is a scheduled task on Wind...
What is services.exe process - Services and Controller app? Process services.exe is part of the Wind...
Where to find tutorials on using Edge Web browser. Here is a collection of tutorials on Edge Web bro...
A collection of 8 tutorials on Internet connections with DSL modems covering: What are required to u...