I am attempting to monitor the java usage on a system which is home to two java applications running binaries "java.exe". I am attempting to get the Display Name which is listed under Windows "Services" so it is easily identifiable which
java app I am working with. How could I go about tying the PID of each java instance back to the service/display name that it is running as?
Overview:
Foreach ($JavaServicePID in (Get-Process -Name java).id)
$ExecutablePath = (Get-Process -Id $JavaServicePID).Path
$DisplayName = ???