1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 22:22:18 +02:00
tldr/pages/windows/tee-object.md
K.B.Dharun Krishna a8ec294384
style-guide, pages/windows/*: add note for PowerShell descriptions (#12904)
*: add note for pwsh descriptions

Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2024-06-07 12:04:32 +02:00

514 B

Tee-Object

Saves command output in a file or variable and also sends it down the pipeline. Note: This command can only be used through PowerShell. More information: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/tee-object.

  • Output processes to a file and to the console:

Get-Process | Tee-Object -FilePath {{path\to\file}}

  • Output processes to a variable and Select-Object:

Get-Process notepad | Tee-Object -Variable {{proc}} | Select-Object processname,handles