I have the following in a text file:
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
abc.exe 9152 Console 1 14,988 K
abc.exe 7964 Console 1 89,188 K
The important thing to note is that both the processes have the same name (abc.exe). Now I need to filter the PID of only one of the processes. I am thinking of outputting the contents of tasklist onto the text file and then filtering the PID from the line I want to. How do I go about doing this preferably using powershell scripting? I am thinking regular expressions but can't get the exact result I want to. This is the relationship between the two processes:
Parent.exe
->abc.exe
->abc.exe