![Forrest logo](/images/logo.png)
tee-object:tldr:3c421
This command is a PowerShell command that performs the following actions:
-
Get-Process notepad
retrieves information about all the running processes with the name "notepad". -
| Tee-Object -Variable ${proc}
pipes the output of theGet-Process
command toTee-Object
cmdlet, which allows you to view and store the output in a variable. In this case, the variable name is${proc}
. -
| Select-Object processname,handles
pipes the output of the previous command to theSelect-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.