# LibTmux.Workspace\Resolve-TmuxWorkspace

- **Package:** LibTmux.Workspace
- **Language:** PowerShell
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/src/LibTmux.Workspace.PowerShell/ResolveTmuxWorkspaceCommand.cs#L9
- **Page:** https://libtmux.org/en/powershell/latest/workspace/reference/libtmux-workspace-resolve-tmuxworkspace/

```
File:
Resolve-TmuxWorkspace
    -File <System.IO.FileInfo>
    [-Variables <System.Collections.IDictionary>]
    [<CommonParameters>]

Path:
Resolve-TmuxWorkspace
    -LiteralPath <System.String>
    [-Variables <System.Collections.IDictionary>]
    [<CommonParameters>]

Workspace (default):
Resolve-TmuxWorkspace
    [-Workspace] <LibTmux.Workspace.WorkspaceFile>
    -BaseDirectory <System.String>
    [-Variables <System.Collections.IDictionary>]
    [<CommonParameters>]
```

Resolve inherited workspace paths against an explicit document base.

Return a replacement native declaration with resolved inherited directories
and option values.
A parsed WorkspaceFile requires an explicit BaseDirectory. LiteralPath and
File read a bounded, seekable UTF-8 YAML/JSON file and use its absolute parent
as the base. Paths use the FileSystem provider without wildcard expansion.
Malformed declarations and invalid UTF-8 retain their native exceptions as
InvalidData errors.

Expansion uses only the supplied case-sensitive string map. Supply HOME for
home-directory expansion in paths; no process environment is copied implicitly.
Dollar pairs represent a literal dollar sign in declaration paths and option
values. [`Session`](/en/csharp/latest/reference/libtmux-session/), window and pane option values expand supplied variables;
unknown variables in option values remain literal. Unresolved path variables
are errors. Option names, command text, the host script, session and window
names, and environment values remain literal. Resolution does not execute
scripts, inspect tmux or require the resulting directories to exist. The input
declaration remains unchanged.

### Notes

Invalid variable maps terminate with [`Tmux.InvalidWorkspaceVariables`](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/reference/LibTmux.Workspace/Resolve-TmuxWorkspace.md#notes) before
processing input. File and resolution failures retain their native exception
under [`Tmux.WorkspaceResolutionFailed`](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/reference/LibTmux.Workspace/Resolve-TmuxWorkspace.md#notes); [`ErrorAction`](/en/powershell/latest/workspace/reference/libtmux-workspace-resolve-tmuxworkspace/#LibTmux.Workspace%5CResolve-TmuxWorkspace.parameter.ErrorAction) Continue permits later input.

## Command details

- **Command type:** [`cmdlet`](/en/powershell/latest/workspace/reference/glossary/#cmdlet)
- **Default parameter set:** Workspace
- **Positional binding:** Enabled.
- **Pipeline inputs:** `LibTmux.Workspace.WorkspaceFile`: A declaration used with BaseDirectory.; `System.IO.FileInfo`: A declaration file to read and resolve.
- **Outputs:** `LibTmux.Workspace.WorkspaceFile`

Related APIs:

- [`Import-TmuxWorkspace`](/en/powershell/latest/workspace/reference/libtmux-workspace-import-tmuxworkspace/)
- [`Test-TmuxWorkspace`](/en/powershell/latest/workspace/reference/libtmux-workspace-test-tmuxworkspace/)
- [`Get-TmuxWorkspacePlan`](/en/powershell/latest/workspace/reference/libtmux-workspace-get-tmuxworkspaceplan/)

## Examples

Example 1

Resolve a parsed declaration against the current filesystem directory. Pass a
different explicit BaseDirectory when the declaration came from elsewhere.

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

```powershell
$resolve = @{
    BaseDirectory = (Get-Location).Path
    Variables = @{ PROJECT = 'src' }
}
LibTmux.Workspace\Import-TmuxWorkspace -Yaml @'
session_name: development
start_directory: "${PROJECT}"
windows:
  - panes: [null]
'@ | LibTmux.Workspace\Resolve-TmuxWorkspace @resolve
```

## Parameters

- `File` (`System.IO.FileInfo`): A FileInfo whose parent becomes the document base. (for `File`)
  Required. Named parameter. Accepts pipeline input by value. [`ValidateNotNull()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnullattribute?view=powershellsdk-7.4.0).
- `Variables` (`System.Collections.IDictionary`): Allowed string expansion variables. Values requiring conversion are rejected.
  Optional. Named parameter. Does not accept pipeline input. [`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`.
- `LiteralPath` (`System.String`): The literal declaration path. The file parent becomes its document base. (for `Path`)
  Required. Named parameter. Does not accept pipeline input. [`ValidateNotNullOrEmpty()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnulloremptyattribute?view=powershellsdk-7.4.0).
- `Workspace` (`LibTmux.Workspace.WorkspaceFile`): The parsed declaration to resolve without reading a file. (for `Workspace`)
  Required. Position 0. Accepts pipeline input by value. [`ValidateNotNull()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnullattribute?view=powershellsdk-7.4.0).
- `BaseDirectory` (`System.String`): The explicit filesystem base for a parsed declaration. Relative bases resolve against the current PowerShell location. (for `Workspace`)
  Required. Named parameter. Does not accept pipeline input. [`ValidateNotNullOrEmpty()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnulloremptyattribute?view=powershellsdk-7.4.0).

## Returns

`LibTmux.Workspace.WorkspaceFile`: The replacement declaration with document-directory provenance.
