-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
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.Resolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or more
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
create 2 functions:
PS> function cmdletB {[CmdletBinding()]param()BEGIN{"b2"}PROCESS{"! p2 !"}END{"e2"}}
PS> function cmdletA {[CmdletBinding()]param()BEGIN{"b1"}PROCESS{"! p1 !";cmdletB}END{"e1"}} this will operate as expected:
PS> cmdletA -pv a| % {"> $a <"}
> b1 <
> ! p1 ! <
> b2 <
> ! p2 ! <
> e2 <
> e1 <however, if you add -pv a to the invocation of cmdletB, you can see the issue.
PS> function cmdletA {[CmdletBinding()]param()BEGIN{"b1"}PROCESS{"! p1 !";cmdletB -pv a}END{"e1"}}
PS> cmdletA -pv a| % {"> $a <"}
> b1 <
> ! p1 ! <
> ! p1 ! <
> ! p1 ! <
> ! p1 ! <
> e1 <it seems to lose all output from cmdletB.
It doesn't seem to matter if you choose a different pipeline variable for cmdletB
PS> function cmdletA {[CmdletBinding()]param()BEGIN{"b1"}PROCESS{"! p1 !";cmdletB -pv b}END{"e1"}}
PS> cmdletA -pv a| % {"> $a $b <"}
> b1 <
> ! p1 ! <
> ! p1 ! <
> ! p1 ! <
> ! p1 ! <
> e1 <possibly related to:
#16199
#12766
Expected behavior
PS> cmdletA -pv a| % {"> $a <"}
> b1 <
> ! p1 ! <
> b2 <
> ! p2 ! <
> e2 <
> e1 <Actual behavior
PS> cmdletA -pv a| % {"> $a <"}
> b1 <
> ! p1 ! <
> ! p1 ! <
> ! p1 ! <
> ! p1 ! <
> e1 <Error details
no errorEnvironment data
PS> $psversiontable
Name Value
---- -----
PSVersion 7.4.0-preview.3
PSEdition Core
GitCommitId 7.4.0-preview.3-29-g07e041fe10d4c753dfccfa46008bdedebdfd3027
OS Darwin 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar 6 21:00:17 PST 2023; root:xnu-8796.101.5~3/RELEASE_X86_64
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
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.Resolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or more