PS> Get-Job Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 2 Job2 BackgroundJob Completed True localhost .\Get-Archive.ps1 4 Job4 RemoteJob Failed True Server01, Server02 .\Get-Archive.ps1 7 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 8 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 9 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 10 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help PS> Get-Job -IncludeChildJob Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 2 Job2 BackgroundJob Completed True localhost .\Get-Archive.ps1 3 Job3 Completed True localhost .\Get-Archive.ps1 4 Job4 RemoteJob Failed True Server01, Server02 .\Get-Archive.ps1 5 Job5 Failed False Server01 .\Get-Archive.ps1 6 Job6 Completed True Server02 .\Get-Archive.ps1 7 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 8 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 9 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 10 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help PS> Get-Job -Name Job4 -ChildJobState Failed Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 2 Job2 BackgroundJob Completed True localhost .\Get-Archive.ps1 4 Job4 RemoteJob Failed True Server01, Server02 .\Get-Archive.ps1 5 Job5 Failed False Server01 .\Get-Archive.ps1 7 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 8 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 9 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 10 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help PS> (Get-Job -Name Job5).JobStateInfo.Reason Connecting to remote server Server01 failed with the following error message: Access is denied.
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter