March 3rd, 2014

PowerTip: Use PowerShell to Keep Job Data

Doctor Scripto
Scripter

Summary: Learn how to use Windows PowerShell to keep job data available for future use.

Hey, Scripting Guy! Question How can I keep my job data?

Hey, Scripting Guy! AnswerOne of the frustrating things about using the Window PowerShell job cmdlets is that if you’re not careful,
          you lose the data in your job when you access the job. The following command returns the job’s data,
          but it also deletes that data:

Receive-Job -Id 8

If you want the data available, use the –Keep parameter:

Receive-Job -Id 10 –Keep

Using –Keep is a good habit to get into. It’ll save you having to rerun a bunch of jobs to regenerate the data.  

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.