Contact Info

Crumbtrail » Administration » Powershell » Powershell 1.0 » Get-Service

Get-Service - Powershell 1.0 CmdLet

Microsoft Windows PowerShell is a command-line shell and scripting tool based on the Microsoft .NET Framework. It is designed for system administrators, engineers and developers to control and automate the administration of Windows and applications.

More than hundred command-line tools (so called "cmdlets") can be used to perform system administration tasks and Windows Management Instrumentation (WMI). These cmdlets are easy to use, with standard naming conventions and common parameters, and standard tools for piping, sorting, filtering, and formatting data and objects.


Get a list of services


-name          Service names to retrieve. Wildcards are permitted. 
   -displayName   Display names of services to retrieve. Wildcards permitted.
   -inputObject   ServiceController object(s) to retrieve.
                  A variable containing objects or a command / expression that
                  gets the objects.

   -Include       Retrieve only the Service Name(s) specified

   -Exclude       Omit the Service Name(s) specified

       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutVariable.

Get all the services on the computer.:

PS C:\>get-service

Get services with names that begin "WMI":

PS C:\>get-service wmi*

Display only services that are currently running:

PS C:\>get-service | where-object {$_.Status -eq "Running"}

Status is only one property of service objects, to see all the properties: get-service | get-member
To retrieve the description of a service use the Win32_Service WMI class:

PS C:\>get-wmiobject win32_service | where-object {$_.Name -eq "Schedule"} | format-list Name, Description