How to Check if a Process is Running in PowerShell

One of my team members was trying to check if a process is running in their system. PowerShell is best suitable for this.

Today, I’m going to show you exactly how to check if a process is running using PowerShell. We’ll start with the basics and work our way up to some really practical examples you can use right away.

Let’s jump in.

Why Would You Want to Check if a Process is Running?

Before we get into the how, let’s talk about the why. Here are some common scenarios:

  • Preventing duplicate instances – You don’t want your script launching the same program multiple times
  • Monitoring critical applications – Making sure your important services are actually running
  • Troubleshooting – Checking if an application is stuck or has crashed
  • Automation scripts – Your script might need to verify a process is running before doing something else
  • Resource management – Finding out what’s hogging your CPU or memory

Alright, now that we know why this matters, let’s get to the good stuff.

Check out How to Kill a Process If It Is Running in PowerShell?

The Basic Command: Get-Process

The workhorse command for checking processes in PowerShell is Get-Process. It’s simple, powerful, and built right into PowerShell.

Open PowerShell and type this:

Get-Process

Hit Enter, and boom – you’ll see a list of every process currently running on your computer. It’ll show you the process name, CPU usage, memory, and a bunch of other details.

But that’s too much information. We need to narrow it down.

Checking for a Specific Process

Let’s say you want to check if Notepad is running. Here’s how:

Get-Process notepad

If Notepad is running, you’ll see something like this:

 NPM(K)    PM(M)      WS(M)     CPU(s)      Id  SI ProcessName
 ------    -----      -----     ------      --  -- -----------
     51   116.90      47.21     142.00   21724   1 Notepad

Here is the exact output in the screenshot below:

Check if a Process is Running in PowerShell

If Notepad isn’t running, you’ll get an error message:

Get-Process : Cannot find a process with the name "notepad".

That error message is actually useful – it tells you the process isn’t running. But those red error messages can be annoying, especially in scripts. We’ll fix that in a minute.

Checking Multiple Processes at Once

You can check for multiple processes in one go:

Get-Process notepad, chrome, excel

This will show you the status of all three processes. If any of them aren’t running, you’ll get an error for just those ones.

Read PowerShell Kill Process by Name

The Wildcard Approach

Sometimes you’re not sure of the exact process name. That’s where wildcards come in handy:

Get-Process *chrome*

This will find any process with “chrome” in its name – like “chrome” or “GoogleChrome” or whatever variation your system uses.

Super useful when you’re not 100% sure what the exact process name is.

Suppressing Those Annoying Error Messages

Remember those red error messages? They’re useful for humans, but they can mess up your scripts. Here’s how to check for a process without errors:

Get-Process notepad -ErrorAction SilentlyContinue

Now if Notepad isn’t running, you just get nothing. No error, no drama.

This is the approach I use most often in scripts because it’s clean and doesn’t clutter up your output.

Checking if a Process is Running (True or False)

Often you just want a simple yes or no answer. Is the process running or not?

Here’s a neat way to do that:

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

This checks if the process exists. If it does, it prints “Notepad is running”. If it doesn’t, you get “Notepad is not running”.

Simple and effective.

Check out PowerShell Start-Process

Using Where-Object for More Control

Sometimes you need more specific criteria. Maybe you want to find a process that’s using a ton of memory, or one with a specific ID.

Here’s how:

Get-Process | Where-Object {$_.ProcessName -eq "notepad"}

The -eq means “equals”. This gives you the same result as Get-Process notepad, but now you have more flexibility.

For example, checking for processes using more than 100MB of memory:

Get-Process | Where-Object {$_.WorkingSet -gt 100MB}

The WorkingSet property is the memory usage, and -gt means “greater than”.

Checking Processes on Remote Computers

Here’s something really cool – you can check processes on other computers in your network:

Get-Process -ComputerName Server01 -Name notepad

This checks if Notepad is running on a computer named “Server01”. You’ll need the appropriate permissions, of course, but it’s incredibly useful for managing multiple machines.

Read How to Use PowerShell Get-Process?

Practical Example: Start a Process Only if It’s Not Running

Here’s a real-world scenario. You want to start Notepad, but only if it’s not already running:

if (!(Get-Process notepad -ErrorAction SilentlyContinue)) {
    Start-Process notepad
    Write-Host "Started Notepad"
} else {
    Write-Host "Notepad is already running"
}

The exclamation mark (!) means “not”, so this reads as “if NOT running, then start it”.

This is super handy in automation scripts where you don’t want duplicate instances cluttering up your system.

Practical Example: Monitor and Restart a Critical Process

Let’s say you have a critical application that sometimes crashes. You want a script to check if it’s running, and if not, restart it:

$processName = "ImportantApp"

if (!(Get-Process $processName -ErrorAction SilentlyContinue)) {
    Write-Host "$processName is not running. Starting it now..."
    Start-Process "C:\Path\To\ImportantApp.exe"
} else {
    Write-Host "$processName is running normally."
}

You could put this in a scheduled task that runs every few minutes, and you’ve got yourself a basic monitoring system.

Practical Example: Wait for a Process to Start

Sometimes you need to wait for a process to start before your script continues:

$processName = "chrome"
$timeout = 30 # seconds

Write-Host "Waiting for $processName to start..."

$timer = [Diagnostics.Stopwatch]::StartNew()

while (!(Get-Process $processName -ErrorAction SilentlyContinue)) {
    if ($timer.Elapsed.TotalSeconds -gt $timeout) {
        Write-Host "Timeout reached. $processName did not start."
        break
    }
    Start-Sleep -Seconds 1
}

if (Get-Process $processName -ErrorAction SilentlyContinue) {
    Write-Host "$processName is now running!"
}

$timer.Stop()

This script waits up to 30 seconds for Chrome to start. It checks every second, and either confirms it started or times out.

Read PowerShell Import-CSV Foreach

Getting More Information About a Process

Sometimes just knowing a process is running isn’t enough. You want details:

Get-Process notepad | Select-Object ProcessName, Id, CPU, WorkingSet, StartTime

This gives you:

  • ProcessName – The name of the process
  • Id – The process ID (useful for killing specific instances)
  • CPU – How much CPU time it’s used
  • WorkingSet – Memory usage in bytes
  • StartTime – When the process started

You can format it nicely too:

Get-Process notepad | Format-List *

This shows every single property available. It’s a lot of information, but sometimes you need it.

Counting How Many Instances Are Running

Maybe you want to know how many instances of a process are running:

(Get-Process chrome -ErrorAction SilentlyContinue).Count

If you have 5 Chrome windows open, this might return 15 or 20 because Chrome uses multiple processes. Still, it’s useful information.

Or make it more readable:

$chromeProcesses = Get-Process chrome -ErrorAction SilentlyContinue
if ($chromeProcesses) {
    Write-Host "Chrome has $($chromeProcesses.Count) processes running"
} else {
    Write-Host "Chrome is not running"
}

Finding Processes by Window Title

Here’s a neat trick. Sometimes you want to find a process based on its window title, not just its name:

Get-Process | Where-Object {$_.MainWindowTitle -like "*Document1*"}

This finds any process with “Document1” in its window title. Super useful when you have multiple instances of the same program open and need to identify a specific one.

Read How to Clear PowerShell History

Using WMI for Even More Details

If Get-Process doesn’t give you enough information, you can use WMI (Windows Management Instrumentation):

Get-WmiObject Win32_Process | Where-Object {$_.Name -eq "notepad.exe"}

WMI gives you additional details like the command line arguments used to start the process:

Get-WmiObject Win32_Process | Where-Object {$_.Name -eq "notepad.exe"} | Select-Object Name, ProcessId, CommandLine

Common Mistakes to Avoid

Wrong process name – Process names often don’t match the program name. For example, Google Chrome’s process is “chrome”, not “googlechrome”. Use Get-Process without parameters first to find the exact name.

Forgetting .exe – Sometimes you need to include .exe, sometimes you don’t. Get-Process notepad and Get-Process notepad.exe both work, but with WMI commands, you usually need the .exe.

Case sensitivity – PowerShell isn’t case-sensitive, so notepad, Notepad, and NOTEPAD all work the same.

Multiple instances – Remember that a program might run multiple processes. Chrome is notorious for this. Your check might return several results.

Wrapping Up

In this tutorial, I explained how to check if a process is running in PowerShell:

  • Use Get-Process for most situations
  • Add -ErrorAction SilentlyContinue to avoid error messages
  • Combine with if statements for decision-making
  • Use Where-Object when you need specific criteria
  • Remember you can check remote computers too

I hope this tutorial helps you.

You may also like:

100 PowerShell cmdlets download free

100 POWERSHELL CMDLETS E-BOOK

FREE Download an eBook that contains 100 PowerShell cmdlets with complete script and examples.