# LibTmux\Stop-TmuxServer

- **Package:** LibTmux
- **Language:** PowerShell
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-powershell/blob/bbab29e574920cd100e4b80688185d91c5d7f877/src/LibTmux.PowerShell/StopTmuxServerCommand.cs#L7
- **Page:** https://libtmux.org/en/powershell/latest/reference/libtmux-stop-tmuxserver/

```
Stop-TmuxServer
    [-Server] <LibTmux.Server>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
```

Stop a native tmux server without emitting an object.

Stop the tmux server that the supplied native LibTmux.Server handle names, with
the tmux [kill-server](/en/tmux/latest/manual/kill-server/) command. Every session, window and pane on that server is
destroyed and its daemon exits. Use it to end a private server you started, such
as one named by New-TmuxServer on a socket of its own.

A server that is already gone is the requested outcome, so an absent daemon
succeeds and nothing is stopped. This high-impact operation requests
confirmation by default. [`WhatIf`](/en/powershell/latest/reference/libtmux-stop-tmuxserver/#LibTmux%5CStop-TmuxServer.parameter.WhatIf) performs no tmux I/O. Cancellation does not
restore a stopped server.

### Notes

Failures use [`Tmux.ServerStopFailed`](https://github.com/libtmux/libtmux-powershell/blob/bbab29e574920cd100e4b80688185d91c5d7f877/docs/reference/LibTmux/Stop-TmuxServer.md#notes) and retain the original core exception, its
dispatch information and the failed server. The stop is never retried. [`Session`](/en/csharp/latest/reference/libtmux-session/),
window and pane handles read from the stopped server no longer name anything.

## Command details

- **Command type:** [`cmdlet`](/en/powershell/latest/reference/glossary/#cmdlet)
- **Confirmation:** Supports `-WhatIf` and `-Confirm`; confirm impact: High.
- **Positional binding:** Enabled.
- **Pipeline inputs:** `LibTmux.Server`: A native LibTmux.Server naming the endpoint to stop.
- **Outputs:** `System.Void`

Related APIs:

- [Remove sessions, windows and panes](https://github.com/libtmux/libtmux-powershell/blob/bbab29e574920cd100e4b80688185d91c5d7f877/docs/remove.md)
- [Choose endpoints and owners](https://github.com/libtmux/libtmux-powershell/blob/bbab29e574920cd100e4b80688185d91c5d7f877/docs/read.md)

## Parameters

- `Server` (`LibTmux.Server`): The native server to stop. Create it with New-TmuxServer, or select it with
Get-TmuxServer, on the endpoint you intend to end.
  Required. Position 0. Accepts pipeline input by value. [`ValidateNotNull()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnullattribute?view=powershellsdk-7.4.0).
- `Verbose` (`System.Management.Automation.SwitchParameter`): Display verbose messages produced by this command.
  Optional. Named parameter. Switch parameter. Common parameter. Does not accept pipeline input. Aliases: `vb`.
- `Debug` (`System.Management.Automation.SwitchParameter`): Display debug messages produced by this command.
  Optional. Named parameter. Switch parameter. Common parameter. Does not accept pipeline input. Aliases: `db`.
- `ErrorAction` (`System.Management.Automation.ActionPreference`): Choose how this command responds to non-terminating errors.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `ea`.
- `WarningAction` (`System.Management.Automation.ActionPreference`): Choose how this command responds to warning messages.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `wa`.
- `InformationAction` (`System.Management.Automation.ActionPreference`): Choose how this command handles information messages.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `infa`.
- `ProgressAction` (`System.Management.Automation.ActionPreference`): Choose how this command handles progress updates.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `proga`.
- `ErrorVariable` (`System.String`): Store the command's error records in the named variable.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `ev`.
- `WarningVariable` (`System.String`): Store the command's warning records in the named variable.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `wv`.
- `InformationVariable` (`System.String`): Store the command's information records in the named variable.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `iv`.
- `OutVariable` (`System.String`): Save output in the named variable while passing it down the pipeline.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `ov`.
- `OutBuffer` (`System.Int32`): Buffer output before passing it to the next pipeline command.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `ob`.
- `PipelineVariable` (`System.String`): Make the most recent output object available through a named variable within the pipeline.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `pv`.
- `WhatIf` (`System.Management.Automation.SwitchParameter`): Runs the command in a mode that only reports what would happen without performing the actions.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input. Aliases: `wi`.
- `Confirm` (`System.Management.Automation.SwitchParameter`): Prompts you for confirmation before running the cmdlet.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input. Aliases: `cf`.

## Returns

`None`: No success objects are emitted. An empty input pipeline performs no work.

## Examples

Example 1

Stop the previously created $server, a private endpoint you own. This example
explicitly suppresses confirmation; omitting Confirm uses the normal
high-impact confirmation behavior.

[Source example](https://github.com/libtmux/libtmux-powershell/blob/bbab29e574920cd100e4b80688185d91c5d7f877/docs/reference/LibTmux/Stop-TmuxServer.md).

```powershell
$server | LibTmux\Stop-TmuxServer -Confirm:$false
```

## Guides

Pages that discuss `Stop-TmuxServer`.

- [Compatibility](/en/powershell/latest/guides/compatibility/)
- [Remove sessions, windows and panes](/en/powershell/latest/guides/remove/)
