O'Reilly logo

Pro Windows PowerShell by Hristo Deshev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

14.2. Administering Services

When working with services, PowerShell passes around System.ServiceProcess. ServiceController objects. The simplest way to get those objects for one or many services is to use the Get-Service cmdlet. When called without parameters, it will return all services registered on the system. We can use the cmdlet to generate quick reports. For example, this command will list just the running services:

Get-Service | where { $_.Status -eq "Running" }
Here is what the result looks like:
Status   Name               DisplayName
------   ----               -----------
Running  AeLookupSvc        Application Experience
Running  Appinfo            Application Information
Running  AudioEndpointBu... Windows Audio Endpoint Builder
Running  Audiosrv           Windows Audio
...

We can search for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required