I would like to build powershell pipeline like
cmd | transform_a | stdout_and | transform_b | store_variable
^
|
copy input to next consumer and to console
I tried to utilize Tee-Object
but without success. I dont want to do this
dir | select -last 5 | tee lastFiveLines | select -first 1
echo $lastFiveLines
altough it works. Instead I want the content to be printed directly.