if((get-process "notepad" -ea SilentlyContinue) -eq $Null){ echo "Not Running" }else{ echo "Running" }
This should cover it. I've tested it and it works fine. You can put anything in the braces, or you can use this in a while loop to wait for a process to die.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.