Skip to content

Commit

Permalink
Fix #4262 - remove service (#4269)
Browse files Browse the repository at this point in the history
* Fix #4262 - remove service

* fix typos

* update runas
  • Loading branch information
sdwheeler authored and DCtheGeek committed May 6, 2019
1 parent b602931 commit a5bfad2
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions reference/6/Microsoft.PowerShell.Management/Remove-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,34 @@ Remove-Service [-InputObject <ServiceController>] [-WhatIf] [-Confirm] [<CommonP

## DESCRIPTION

The **Remove-Service** cmdlet removes a Windows service in the registry and in the service database.
The `Remove-Service` cmdlet removes a Windows service in the registry and in the service database.

## EXAMPLES

### Example 1: Remove a service

```
PS C:\> Remove-Service -Name "TestService"
```
This removes a service named TestService.

This command removes a service named TestService.
```powershell
Remove-Service -Name "TestService"
```

### Example 2: Remove a service using the display name

```
PS C:\> Get-Service -DisplayName "Test Service" | Remove-Service
```
This example removes a service named TestService. The command uses `Get-Service` to get an object
that represents the TestService service using the display name. The pipeline operator (|) pipes the
object to `Remove-Service`, which removes the service.

This command creates a service named TestService.
The command uses **Get-Service** to get an object that represents the TestService service using the display name.
The pipeline operator (|) pipes the object to **Remove-Service**, which removes the service.
```powershell
Get-Service -DisplayName "Test Service" | Remove-Service
```

## PARAMETERS

### -InputObject

Specifies **ServiceController** objects that represent the services to stop.
Enter a variable that contains the objects, or type a command or expression that gets the objects.
Specifies **ServiceController** objects that represent the services to stop. Enter a variable that
contains the objects, or type a command or expression that gets the objects.

```yaml
Type: ServiceController
Expand All @@ -72,8 +72,7 @@ Accept wildcard characters: False
### -Name
Specifies the service names of the services to stop.
Wildcard characters are permitted.
Specifies the service names of the services to remove. Wildcard characters are permitted.
```yaml
Type: String
Expand Down Expand Up @@ -105,8 +104,7 @@ Accept wildcard characters: False
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Shows what would happen if the cmdlet runs. The cmdlet is not run.
```yaml
Type: SwitchParameter
Expand All @@ -122,7 +120,9 @@ Accept wildcard characters: False
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
Expand All @@ -138,7 +138,7 @@ This cmdlet does not return any output.
## NOTES
* To run this cmdlet on Windows Vista and later versions of the Windows operating system, start PowerShell by using the Run as administrator option.
To run this cmdlet, start PowerShell by using the **Run as administrator** option.
## RELATED LINKS
Expand Down

0 comments on commit a5bfad2

Please sign in to comment.