How to Check if a Service is Running in PowerShell

This tutorial will show you quick methods and techniques for checking whether a service is running using Windows PowerShell.

How to Check if a Service is Running in PowerShell

Service management is a common task for developers and sys admins. When working in the terminal, you may need to quickly get a glance at the running service or check if a specific service is running.

Using Get-Service cmdlet.

The Get-Service cmdlet is a PowerShell cmdlet that allows you to retrieve information about services on a local or remote computer. It can display the status, configuration, and other information about services.

We can use it to check for running services and then filter by the name of the service we wish to check.

For example, to check if the Windows Update Service is running, we can run the command:

Get-Service wuauserv | Where-Object {$_.Status -eq "Running"}

If the service is running, the command above should return the details of the service as shown:

Status   Name               DisplayName
------   ----               -----------
Running  wuauserv           Windows Update

However, if the service is not running, the command should return an empty list.

If you want to check the status of the service and don't need the full information, you can use the -Status parameter instead:

Get-Service -Name WLAN* -Status Running

This will return only the names of the running services that match the specified name.

Conclusion

This short tutorial showed you how you can use the Get-Service cmdlet in Windows PowerShell to check is a given service is running.

If you enjoy our content, please consider buying us a coffee to support our work:

Table of Contents
Great! Next, complete checkout for full access to GeekBits.
Welcome back! You've successfully signed in.
You've successfully subscribed to GeekBits.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info has been updated.
Your billing was not updated.