Tests if a service exists, without writing anything out to the error stream.
Test-Service [-Name] <String> [<CommonParameters>]
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.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name | String | The name of the service to test. |
true | false |
Test-Service -Name 'Drive'
Returns true
if the Drive
service exists. False
otherwise.