Ensure -PipelineVariable is set for all output from script cmdlets by vexx32 · Pull Request #12766 · PowerShell/PowerShell

There are probably numerous odd cases where this might crop up, but I can't think of any that are really different from the test case here. At the very least, this does cover the test case that we know is currently broken.

I've not seen any other cases crop up myself, nor had someone drop in the community channels with an issue that came down to this. I suspect that that's more due to -PipelineVariable being a bit more of a niche concept from the start, though.

Without knowing for sure about other broken cases, the best I can do is test a few other cases with multiple script cmdlets and various mixes of script / compiled cmdlets to see if the logic breaks down anywhere.

The only real unknown where I don't know what to actually expect is what is meant to happen if multiple cmdlets in the same pipeline declare the same pipeline variable. I'm not sure the expected behaviour there is even recorded anywhere. Best guess - the nearest command to the variable's usage will have its output in there at any given point...

If anyone else has cases they know to be broken / likely to break, I'd appreciate having those as well.