Test-Service

Tests if a service exists, without writing anything out to the error stream.

Syntax

Test-Service [-Name] <String> [<CommonParameters>]

Description

Get-Service writes an error when a service doesn't exist. This function tests if a service exists without writing anyting to the output stream.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
Name String

The name of the service to test.

true false

Return Values

System.Boolean.

EXAMPLE 1

Test-Service -Name 'Drive'

Returns true if the Drive service exists. False otherwise.