Remove-Service

Remove a Windows service from the registry and the service database. First introduced in PowerShell 6.0.

Syntax
      Remove-Service [-Name] String [-WhatIf] [-Confirm] [CommonParameters]

      Remove-Service [-InputObject ServiceController] [-WhatIf] [-Confirm] [CommonParameters]

Key
   -Name string
       The service names of the services to remove. Wildcards are permitted.

   -InputObject ServiceController
       Remove the services represented by ServiceController.
       Enter a command, expression or variable contains the objects.

   -Confirm
       Prompt for confirmation before running the cmdlet.

   -WhatIf
       Describe what would happen if you executed the command without
       actually executing the command.

Standard Aliases for Remove-Service: none

Examples

Remove a service named TestService:

PS C:\> Remove-Service -Name "TestService"

“Remember, with old-fashioned advertising, you could measure whether a product did better after an ad was run, but now companies are measuring whether individuals changed their behaviors, and the feeds for each person are constantly tweaked to get individual behavior to change” ~ Jaron Lanier

Related PowerShell Cmdlets

Get-Service - Get a list of services.
New-Service - Create a new service.
Restart-Service
- Restart a stopped service.
Resume-Service
- Resume a suspended service.
Set-Service
- Make and set changes to the properties of a service.
Start-Service
- Start a stopped service.
Suspend-Service
- Suspend a running service.
Windows cmd command: SC DELETE - delete a service


 
Copyright © 1999-2026 SS64.com
Some rights reserved