Could you please help me to write an excel macro which will check; is there any background Power Shell script is running in the machine?
Thanks, Aneesh
Could you please help me to write an excel macro which will check; is there any background Power Shell script is running in the machine?
Thanks, Aneesh
Sub IsPowerShellRunning()
Debug.Print IsProcessRunning("powershell.exe")
End Sub
Function IsProcessRunning(process As String) as Boolean
Dim objList As Object
Set objList = GetObject("winmgmts:") _
.ExecQuery("select * from win32_process where name='" & process & "'")
If objList.Count > 0 Then
IsProcessRunning = True
Else
IsProcessRunning = False
End If
End Function
(Source)