I am forced to use software that was some serious issues from time to time with CPU usage. Until I can get rid of my Cold Fusion server for good, I need to find a way to kill a process when it takes more than 98% CPU utilization for a given interval (say 60 secs as an example). I have found several scripts that do different parts of what I want, but can't seem to get everything I need. I have just started learning powershell and when I came across this site and figured you might be able to provide guidance.
1) I need it to kill the process as stated. This is better than restating the service for several reasons, which i wont go into.
2) I need it to calculate the CPU usage (not CPU time) for all processes and identify the problem process so that it can do the above. I need this part since there are multiple instances and its not always the same one that causes my issue.
3) I need it to run continuously. Even after it has killed a process. I have found a couple of scripts that run until an action is needed, then they exit. So the effect is they only run once.
Thanks for any help!!