< Back

Uninstall-CService

Sun Jan 12, 2020 11:43 pm

NAME Uninstall-CService



SYNOPSIS

Removes/deletes a service.





SYNTAX

Uninstall-CService [-Name] <String> [[-StopTimeout] <TimeSpan>] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Removes an existing Windows service. If the service doesn't exist, nothing happens. The service is stopped

before being deleted, so that the computer doesn't need to be restarted for the removal to complete.



Beginning in Carbon 2.7, if the service's process is still running after the service is stopped (some services

don't behave nicely) and the service is only running one process, `Uninstall-CService` will kill the service's

process. This helps prevent requiring a reboot. If you want to give the service time to





PARAMETERS

-Name <String>

The service name to delete.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-StopTimeout <TimeSpan>

The amount of time to wait for the service to stop before attempting to kill it. The default is not to wait.



This parameter was added in Carbon 2.7.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

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



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



PS C:\\>Uninstall-CService -Name DeathStar



Removes the Death Star Windows service. It is destro..., er, stopped first, then destro..., er, deleted. If only

the rebels weren't using Linux!











RELATED LINKS

Carbon_Service

Install-CService