-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Labels
Needs-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
The following code produces duplicate verbose messages. During a large job, this can amount to gigabytes of logs:
$job = Start-ThreadJob -StreamingHost $Host -ScriptBlock {
Write-Verbose "yo" -Verbose
Start-Sleep -Seconds 2
}
Receive-Job -Job $job -Wait -Verbose
Also can reproduce with Write-Debug:
$job = Start-ThreadJob -StreamingHost $Host -ScriptBlock {
Write-Debug "yo" -Debug
Start-Sleep -Seconds 2
}
Receive-Job -Job $job -Wait -Debug
Other ways of reproducing:
Start-ThreadJob -StreamingHost $Host -ScriptBlock { Write-Verbose "yo" -Verbose; Start-Sleep -Seconds 1 } | Receive-Job -Wait -Verbose
This seems to require the following elements to reproduce:
- A threadjob with streaminghost, or at least a streaminghost.
- Forced
Write-Verboseor other stream forced command inside the threadjob (e.g.Write-Verbose "yo" -Verbose) Receive job -Wait -Verboseor similar stream (debug works too)- Don't wait for the job (if you wait prior to receive job commandlet, it will not reproduce). Receive job must do the waiting
Expected behavior
VERBOSE: yoActual behavior
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yo
VERBOSE: yoError details
N/AEnvironment data
Powershell version:
PS C:\git> $psversiontable
Name Value
---- -----
PSVersion 7.5.4
PSEdition Core
GitCommitId 7.5.4
OS Microsoft Windows 10.0.26200
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
We also reproduced on 2 machines, 7.5.3 and 7.5.4, and Azure cloud shellVisuals
No response
mklement0
Metadata
Metadata
Assignees
Labels
Needs-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.