Tag Archives: get-process

PowerShell: Check if a process is running and if not start it

Had a requirement to do this, and here’s what I came up with: if((Get-Process -Name notepad -ErrorAction SilentlyContinue) -eq $null){ .”C:\Windows\notepad.exe” } The thing that happens if the process we check for, could obviously be anything. You might want to … Continue reading

Rate this:

Posted in PowerShell | Tagged , , , , , | Leave a comment