Forrest logo
back to the Get-Process tool

tee-object:tldr:3c421

tee-object: Output processes to a variable and `Select-Object`.
$ Get-Process notepad | Tee-Object -Variable ${proc} | Select-Object processname,handles
try on your machine

This command is a PowerShell command that performs the following actions:

  1. Get-Process notepad retrieves information about all the running processes with the name "notepad".

  2. | Tee-Object -Variable ${proc} pipes the output of the Get-Process command to Tee-Object cmdlet, which allows you to view and store the output in a variable. In this case, the variable name is ${proc}.

  3. | Select-Object processname,handles pipes the output of the previous command to the Select-Object cmdlet, which filters the properties of the processes and selects only the properties called "processname" and "handles". It then displays this filtered information in the console.

The purpose of this command is to retrieve the process name and handles of the running "notepad" processes and display them in the console. Additionally, the information is stored in the ${proc} variable for potential further use in the script or PowerShell session.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the Get-Process tool