Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
23 views
in PowerShell by 12 13 22
edited by
I need to verify if a specific process, such as "notepad.exe," is running on my local machine. Is it possible to check this using PowerShell?

1 Answer

0 like 0 dislike
by 164 208 429

Check Service status using PowerShell

Yes, you can use the Get-Process cmdlet to check if a process is running.

if (Get-Process -Name "notepad" -ErrorAction SilentlyContinue) {
    Write-Output "Notepad is running."
} else {
    Write-Output "Notepad is not running."
}

Output

If you don’t ask, the answer is always NO!
...