# LibTmux\Get-TmuxClient

- **Package:** LibTmux
- **Language:** PowerShell
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/src/LibTmux.PowerShell/GetTmuxClientCommand.cs#L7
- **Page:** https://libtmux.org/en/powershell/latest/reference/libtmux-get-tmuxclient/

tmux command: [`list-clients`](/en/tmux/latest/manual/list-clients/)

```
Get-TmuxClient
    [-Server] <LibTmux.Server>
    [-Name <System.String>]
    [<CommonParameters>]
```

Read the clients attached to a tmux server.

Read current client rows through the native core. Name is an ordinal literal
selector, not a wildcard or tmux target expression. Return native [`Client`](/en/csharp/latest/reference/libtmux-client/)
objects; an empty server or unmatched name produces no objects.
[`AttachedSessionId`](/en/csharp/latest/reference/libtmux-client-attachedsessionid/) is captured state, so use [`Get-TmuxClientAttachment`](/en/powershell/latest/reference/libtmux-get-tmuxclientattachment/) to resolve
the current attachment.

### Notes

This read does not attach, detach or own any client. Listing an unavailable
server writes an error.

## Command details

- **Command type:** [`cmdlet`](/en/powershell/latest/reference/glossary/#cmdlet)
- **Positional binding:** Enabled.
- **Pipeline inputs:** `LibTmux.Server`: Native pipeline owner.
- **Outputs:** `LibTmux.Client`

Related APIs:

- [Task guide](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/clients.md)

## Examples

Example 1

Read clients from a previously selected native $server.

[Source example](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/reference/LibTmux/Get-TmuxClient.md).

```powershell
$server | LibTmux\Get-TmuxClient
```

## Parameters

- `Server` (`LibTmux.Server`): The server whose attached clients are listed.
  Required. Position 0. Accepts pipeline input by value. [`ValidateNotNull()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnullattribute?view=powershellsdk-7.4.0).
- `Name` (`System.String`): An exact, case-sensitive client name.
  Optional. Named parameter. Does not accept pipeline input. [`ValidateNotNullOrEmpty()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnulloremptyattribute?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`.

## Returns

`LibTmux.Client`: Native observed result.

## In other ports

### List the server's attached clients

- Julia: [`LibTmux.clients`](/en/julia/latest/reference/libtmux-clients/) (function). `clients` reads attached clients from a captured `Snapshot` without contacting tmux.
- Python: [`libtmux.Server.clients`](/en/py/latest/reference/libtmux-server-clients/) (property)
- Ruby: [`LibTmux::Server#list_clients`](/en/ruby/latest/reference/libtmux-server-list_clients/) (method)
- TypeScript: [`server.Server.clients`](/en/ts/latest/reference/server-server-clients/) (method)
- Rust: [`server.Server.clients`](/en/rs/latest/reference/server-server-clients/) (method)
- Go: [`tmux.Server.Clients`](/en/go/latest/reference/tmux-server-clients/) (method)
- Java: [`io.github.libtmux.Server.Server.clients`](/en/java/latest/reference/io-github-libtmux-server-server-clients/) (method)
- C#: [`LibTmux.Server.Clients`](/en/csharp/latest/reference/libtmux-server-clients/) (property)
- C++: [`libtmux::Server::clients`](/en/cxx/latest/reference/libtmux-server-clients/) (method)
- Swift: [`Server.clients()`](/en/swift/latest/reference/server-clients()/) (method)
- Kotlin: [`io.github.libtmux.kotlin.Server.clients`](/en/kotlin/latest/reference/io-github-libtmux-kotlin-server-clients/) (method)
- Scala: [`io.github.libtmux.scaladsl.Server.clients`](/en/scala/latest/reference/io-github-libtmux-scaladsl-server-clients/) (method)
- F#: [`LibTmux.FSharp.Server.clients`](/en/fsharp/latest/reference/libtmux-fsharp-server-clients/) (function). Builds a deferred client query on the shared .NET `LibTmux.Server`. `Query.list` acquires attached clients.
