PowerShell Genie

PowerShell job completes but no result is visible

Incident 2 min read Troubleshooting walkthrough

Documentation: Microsoft Learn

Work the problem

The job is complete

Fictional case: Get-Job shows Completed and HasMoreData is True. No report rows have appeared in the parent console.

What should you do next?

Reasoning notebook

Record the evidence that supports your answer and the check you would run next. Your notes stay in this browser — nothing is uploaded.

Why it happens

Job output is buffered on the job object until something collects it, so it never reaches the console on its own. Receive-Job drains that buffer once and discards it unless -Keep is supplied, which is why a second call returns nothing. Errors raised inside the job are stored on the child job rather than surfacing in the parent session.

Check this first

1PS> Get-Job; Receive-Job $Job -Keep; $Job.ChildJobs | Select-Object State,JobStateInfo,Error

What to look for

Background job output is collected separately. Receive-Job retrieves it; inspect errors as well as success output.

Working through it

  1. Run Get-Job and read State together with HasMoreData for the job in question.
  2. Call Receive-Job $Job -Keep so the output survives repeated reads while you investigate.
  3. Inspect $Job.ChildJobs and read the Error collection on each, which is where in-job failures are recorded.
  4. Read JobStateInfo.Reason on a job reported as Failed for the terminating exception.
  5. Confirm the script block emits objects rather than writing with Write-Host, which does not travel through the output stream.

Avoiding it next time

Verify the repair: Check the returned records and errors. Use -Keep when you deliberately need to receive the same buffered output again.

Primary documentation

PowerShell objects and pipelines documentation

Work through the incident

Retrieve a completed job

A background job is completed, but the expected records are not in your foreground output.

Review the lesson

Genie guidePowerShell job completes but no result is visible

Start with the symptom, then inspect the checks and evidence. These are investigation steps; more than one cause may fit.