In powershell, how do I check if a program is running by using the full path of the program executable? Or do I need to parse the path to get the process name?
Thanks.
EDIT:
I need to know if the executable "C:\My Temporary Programs\Test 1.exe" is running.
Try this:
get-process | ?{$_.path -eq $path}
So you can do something like:
if(get-process | ?{$_.path -eq "C:\My Temporary Programs\Test 1.exe"}){
#exe is running. Do what you want
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With