PowerShell job completes but no result is visible
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.
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
What to look for
Background job output is collected separately. Receive-Job retrieves it; inspect errors as well as success output.
Working through it
- Run Get-Job and read State together with HasMoreData for the job in question.
- Call Receive-Job $Job -Keep so the output survives repeated reads while you investigate.
- Inspect $Job.ChildJobs and read the Error collection on each, which is where in-job failures are recorded.
- Read JobStateInfo.Reason on a job reported as Failed for the terminating exception.
- 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
Work through the incident
Retrieve a completed job
A background job is completed, but the expected records are not in your foreground output.
The sandbox is visible now. Sign in with Google only when you run or check a task; commands and temporary files are discarded when you leave.
Run a command to inspect its result.