How to wait and kill a timeout process in Powershell

前端 未结 2 699
旧时难觅i
旧时难觅i 2021-01-05 05:30

Using Powershell 2.0 in a Windows 7 desktop

I want to create a process to run an ant command, and then wait for that process to finish in several minutes. If time ou

相关标签:
2条回答
  • 2021-01-05 06:05

    I pushed in github tiny project which can be used to run process and setup timeout for him and for his child proccesses: https://github.com/burlachenkok/process_tool

    It's a sources with Makefile, and it's not a powershell script. But hope it can be usefull for you.

    0 讨论(0)
  • 2021-01-05 06:12

    If you want to kill the entire process tree, you need to also find and stop the child processes.

    Here's a good article that explains it and shows you how to do that:

    http://powershell.com/cs/blogs/tobias/archive/2012/05/09/managing-child-processes.aspx

    0 讨论(0)
提交回复
热议问题