`Tee-Object` should have a `-Console` parameter
See original GitHub issueSummary of the new feature / enhancement
From the PowerShell for every system! idea, Tee-Object
shouldn’t need a system specific value expression to output to a console (and the pipeline) but simply tee the object to both the success stream and the information stream.
Get-Content data.txt | Tee-Object ($IsWindows ? '\\.\CON': '/dev/tty') | data_processor.exe
</strike>
Proposed technical implementation details (optional)
Wishful thinking: (see: Can you redirect Tee-Object to standard out?)
Get-Content data.txt | Tee-Object -Console | data_processor.exe
Issue Analytics
- State:
- Created 3 months ago
- Reactions:5
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Tee-Object (Microsoft.PowerShell.Utility)
Tee -Object prints the piped results to the console using the FileName parameter. Where-Object filters the files by getting their content as a...
Read more >Tee-Object: The Most Underused Cmdlet in PowerShell
The Tee-Object cmdlet has a FilePath parameter we can use to save the output to a file. Here's what this same task would...
Read more >PowerShell console output from Tee-Object command ...
As the output stream has been stored into a variable, it won't go further up in the function call chain, so it won't...
Read more >Tee-Object - PowerShell
Syntax Tee-Object [-inputObject psobject] [-filePath] string [-Append] [CommonParameters] ... This parameter was introduced in Windows PowerShell 3.0.
Read more >Tee-Object: The Most Underused Cmdlet in PowerShell
The cmdlet “Tee-Object” in PowerShell sends or stores the output in two ways. One in the output variable or file and another in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The cmdlet working group reviewed this and finds it a valuable addition. We believe it’s appropriate to call the parameter -Host because there are other hosts beside the console, i.e. VSCode.
The parameter should be called
Host
since there could be a custom PS host that isn’t a console and also matchesOut-Host
writing to theInformation
stream.