Skip to content

Document the renamed -BasePath parameter (formerly -RelativeBasePath) of Resolve-Path #13379

Open

Description

@soroshsabz

Prerequisites

  • Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
  • Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Document new Get-Foo cmdlet" instead of "New cmdlet."

Summary

PowerShell is renaming the -RelativeBasePath parameter of Resolve-Path to -BasePath in PowerShell 7.7. The original -RelativeBasePath name remains available as a parameter alias for backwards compatibility. The cmdlet reference needs to document the new parameter name and the alias.

Details

The rename was proposed in PowerShell/PowerShell#20937: the name -RelativeBasePath tempted users to assume the parameter only works together with the -Relative switch (or that it implies -Relative), and a distinct shorter name is easier to tab-complete. The parameter was added in PowerShell 7.4 as -RelativeBasePath and is renamed to -BasePath in PowerShell 7.7.

The parameter resolves the -Path or -LiteralPath values relative to the given base path: without -Relative the cmdlet returns PathInfo objects for the resolved paths; with -Relative it returns a string representing the relative path from the base path to the resolved paths.

Articles

  • Resolve-Path (reference/7.7/Microsoft.PowerShell.Management/Resolve-Path.md)

Suggested updates:

  1. Rename the ### -RelativeBasePath parameter section to ### -BasePath, list RelativeBasePath as an alias in the yaml block, and note the rename in PowerShell 7.7.
  2. Update the SYNTAX blocks and Example 7 (Resolve a path relative to another folder) to use -BasePath.

Suggested content

Parameter description for -BasePath:

Specifies a path to resolve the path from. When you use this parameter, the cmdlet resolves the value of the Path or LiteralPath parameter relative to the base path and returns the System.Management.Automation.PathInfo object for the resolved path.

When you use this parameter with the Relative switch parameter, the cmdlet returns a string representing the relative path from BasePath to Path.

This parameter was added in PowerShell 7.4 as RelativeBasePath and renamed to BasePath in PowerShell 7.7. The original parameter name remains available as an alias for backwards compatibility.

Example:

$ExecutablePath = Get-Command -Name pwsh | Select-Object -ExpandProperty Source
Resolve-Path -Path $ExecutablePath -BasePath $Env:TEMP -Relative

Related Source Pull Requests

Related Source Issues

Activity

  1. changed the title [-]Resolve-Path: -RelativeBasePath parameter renamed to -BasePath in PowerShell 7.7[/-] [+]Document the renamed `-BasePath` parameter (formerly `-RelativeBasePath`) of Resolve-Path[/+] on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions