Assert-Service

Checks if a service exists, and writes an error if it doesn't.

Syntax

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

Description

Also returns True if the service exists, False if it doesn't.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
Name String

The name of the service.

true false

Return Values

System.Boolean.

EXAMPLE 1

Assert-Service -Name 'Drivetrain'

Writes an error if the Drivetrain service doesn't exist.