I have a third party application that uses .bat batch files to kick off their java applications. (It's pentaho, but not sure that matters much for what I'm doing).
I'd like to be able to get a hold of the process that it spawns to track resource usage like memory/cpu/runtime.
Trying something like
$p=Start-Process kitchen.bat -PassThru
Returns quickly, $p has a "processId" but by the time I can do anything with it it's already gone.
I can't just spin waiting for a java process because there are many running simultaneously.
Also, the primary batch file ultimately calls another batch file, adding yet another level of redirection.
- How do I identify and grab ahold of my java process ultimately spawned from these batch files?