-
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
Start-ThreadJob doesn't produce output for Information, Verbose, Debug in most cases. Here's a trivial test
Start-ThreadJob -ScriptBlock {
$InformationPreference='Continue'
$VerbosePreference='Continue'
$DebugPreference='Continue'
Write-Host "Starting test"
Write-Information "Write-Information -InformationAction Continue" -InformationAction Continue
Write-Information "Write-Information"
Write-Verbose "Write-Verbose -Verbose" -Verbose
Write-Verbose "Write-Verbose"
Write-Debug "Write-Debug -Debug" -Debug
Write-Debug "Write-Debug"
} | Receive-Job -Wait -AutoRemoveJobUsing Start-Job works. It appears to be that the thread job will only use the preferences variable from the caller, but ignore ones within the script or the switches.
The workaround is to set variables in the calling instance before calling Start-ThreadJob
$InformationPreference='Continue'
$VerbosePreference='Continue'
$DebugPreference='Continue'
Start-ThreadJob ...This may be related to #24016
Expected behavior
Starting test
Write-Information -InformationAction Continue
Write-Information
VERBOSE: Write-Verbose -Verbose
VERBOSE: Write-Verbose
DEBUG: Write-Debug -Debug
DEBUG: Write-DebugActual behavior
Starting testError details
Environment data
Name Value
---- -----
PSVersion 7.5.4
PSEdition Core
GitCommitId 7.5.4
OS Darwin 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
No response
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.