So let's understand the PowerShell job
flow. Well first off, we start the
PowerShell job. Then we can retrieve the
job, so get the information about the job,
the current status, etc. We'll then need
to wait for the job to execute its
commands. And then we can retrieve the
results from whatever we passed into that
job, whether it was a PS script that we
passed or we just had it execute another
command. And then, of course, we can
remove the job. And that's the process
flow that we should go through when
utilizing background jobs. We start the
job, wait, retrieve, receive, etc., and
then clear the job up. It's important to
understand that we do remove jobs at the
end so they don't just sit in the batch
queue and be listed there. So that process
flow has specific PowerShell cmdlets that
are tied to each object. So to initiate
the job, we use Start‑Job. To get the
current status of the job, we can use
Get‑Job. To wait for the job, we can use
Wait‑Job. To retrieve the results for the
job, we use Receive‑Job. And then to clear that job down, we use Remove‑Job.