GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Job results (from Receive-Job) are grouped by output type, differently than "normal" (BackgroundJob) jobs · Issue #40 · PowerShell/ThreadJob Open DescriptionConsider the following code which starts a ThreadJob: $job = Start-ThreadJob -ScriptBlock { for( $i = 0 ; $i -lt 100 ; $i++ ) { Write-Output "output $i" Write-Host "host output $i" Write-Information "info output $i" Write-Verbose "verbose output $i" Write-Warning "warning output $i" Start-Sleep -Seconds 5 } } If I receive results of the job, the output is grouped according to the type of output: PS C:\Users\me> Receive-Job $job output 0 output 1 output 2 WARNING: warning output 0 WARNING: warning output 1 WARNING: warning output 2 host output 0 host output 1 host output 2 PS C:\Users\me> This is in contrast to “normal” jobs—if I switch the call out for PS C:\Users\me> Receive-Job $job output 0 host output 0 WARNING: warning output 0 output 1 host output 1 WARNING: warning output 1 output 2 host output 2 WARNING: warning output 2 PS C:\Users\me> Expected behaviorI expect the output from This is because I expect to be able to use thread jobs as a "drop-in" replacement for background jobs (modulo restrictions imposed due to running in the same process, like of course you wouldn't be able to load different versions of .NET assemblies). Actual behaviorThe output from a ThreadJob is all grouped by output type (all Warnings grouped together, all host output grouped together, etc.). Environment dataName Value ---- ----- PSVersion 7.4.5 PSEdition Core GitCommitId 7.4.5 OS Microsoft Windows 10.0.26290 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0 PS C:\Users\me> gmo *thread* ModuleType Version PreRelease Name ExportedCommands ---------- ------- ---------- ---- ---------------- Binary 2.1.0 Microsoft.PowerShell.ThreadJob Start-ThreadJob Version7.4.5 / 2.1.0 Reacted by Michael Klement, alx9r, Martin Ba, Manfred Wallner and Cody Konior ActivityMetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |