【问题标题】:I want to check if process is in ideal state or not我想检查进程是否处于理想状态
【发布时间】:2020-04-16 10:36:24
【问题描述】:

我想检查 msiexec 是处于理想状态还是处于停止状态。如何用powershell检查它?

【问题讨论】:

  • ideal state 你的意思是“跑步”?

标签: powershell shell powershell-2.0 powershell-3.0


【解决方案1】:

你可以这样做:

$chk = Get-Process -Name msiexec -ErrorAction SilentlyContinue
if ($chk -eq $null)
{ 
  # Here goes the statements which will be executed if the process msiexec is not running / stopped
}
else
{
  # Here goes the statements which will be executed if the process msiexec is running / ideal state
}

【讨论】:

    猜你喜欢
    • 2020-05-20
    • 1970-01-01
    • 1970-01-01
    • 2013-01-29
    • 1970-01-01
    • 2011-03-10
    • 2016-07-17
    • 1970-01-01
    • 2020-01-11
    相关资源
    最近更新 更多