Please feel free to provide feedback or file bugs here.

Transcript does not log the Verbose and Warning stream of Receive-Job

Problem
------------------------------------------------------
When we run a job inside a transcript, the Verbose and the Warning streams of the jobs are not displayed in the transcript. However, we can see the in the console correctly.

Steps to reproduce
--------------------------------------------
Run the following script
Start-Transcript -Path 'C:\Logs\DemoJobsTranscriptOutput.txt' -Append | Out-Null

$VerbosePreference = "continue"
$WarningPreference = "continue"

$jobs = @()

$jobs += Start-Job -ScriptBlock {
$VerbosePreference = "continue"
$WarningPreference = "continue"
"Begin job"
Write-Verbose "Verbose!"
Write-Warning "Warning!"
"End job"
} -Name "Demo"

$jobs | Wait-Job | Out-Null

$jobs | % {
"Result for job '$($_.Name)'"
$_ | Receive-Job -Verbose
}

$jobs | Remove-Job | Out-Null

Stop-Transcript

Expected behavior
------------------------------------------------
The transcript should capture the Verbose and the Warning logs

Actual behavior
-------------------------------------------------
This is the PowerShell output.

VERBOSE: Result for job 'Demo'
Begin job
VERBOSE: Verbose!
WARNING: Warning!
End job
This is the Transcript 'C:\Logs\DemoJobsTranscriptOutput.txt'

**********************
Windows PowerShell transcript start
Start time: 20180110171727
Username: me
RunAs User: me
Machine: (Microsoft Windows NT 10.0.14393.0)
Host Application: C:\WINDOWS\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe
Process ID: 8600
PSVersion: 5.1.14393.1884
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.14393.1884
BuildVersion: 10.0.14393.1884
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
**********************
VERBOSE: Result for job 'Demo'
Begin job
End job
**********************
Windows PowerShell transcript end
End time: 20180110171727
**********************

Environment data
--------------------------------------
PSVersion 5.1.14393.1884
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.1884
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

1 vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Alexandre Gaudreault shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base