A child job is an individual background job beneath a parent job. A PowerShell job normally has at least one child job, even when the work runs locally. section 14.8 section 14.3
Use child jobs when you need to inspect results or failures separately:
- List a parent's children with Get-Job -id 1 | Select-Object -ExpandProperty ChildJobs. section 14.8
- Retrieve one child job by name or ID with Receive-Job. section 14.8
- Check children separately when a multi-target job fails; each child can report a different error. section 14.9
PS /Users/travisp> get-job -id 1 | format-list *
State : Completed
HasMoreData : True
StatusMessage :
Location : localhost
Command : dir
JobStateInfo : Completed
Finished : System.Threading.ManualResetEvent
InstanceId : e1ddde9e-81e7-4b18-93c4-4c1d2a5c372c
Id : 1
Name : Job1
ChildJobs : {Job2}
PSBeginTime : 12/27/2019 2:34:25 PM
PSEndTime : 12/27/2019 2:34:29 PM
PSJobTypeName : BackgroundJob
Output : {}
Error : {}
Progress : {}
Verbose : {}
Debug : {}
Warning : {}
Information : {}
Inspect the parent and child properties side by side to see their IDs, states, commands, locations, and cached output. section 14.8
