Timeout Get-WMIObject cmdlet

后端 未结 6 1306
星月不相逢
星月不相逢 2020-12-06 15:00

I run a script which performs many WMI-querys - but the cmdlet hangs if the server doesn\'t answer.. Is there any way I can make this (or any other cmndlet for that matter)

6条回答
  •  感动是毒
    2020-12-06 15:16

    The only two solutions I've seen for this problem are:

    1. Run the queries as background jobs and put a timer on them, then stop/remove the jobs that run too long.

    2. Fix your servers.

提交回复
热议问题