< Back

Assert-CService

Sun Jan 12, 2020 8:57 pm

NAME Assert-CService



SYNOPSIS

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





SYNTAX

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





DESCRIPTION

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





PARAMETERS

-Name <String>

The name of the service.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

System.Boolean.





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Assert-CService -Name 'Drivetrain'



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











RELATED LINKS

Test-CService