Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Resolve-Path -RelativeBasePath is ignored unless -Relative is also specified, should imply the latter #20920

Copy link
Copy link
@mklement0

Description

@mklement0
Issue body actions

Prerequisites

Steps to reproduce

The -RelativeBasePath string parameter qualifies the -Relative switch.

Currently, -RelativeBasePath is ignored if -Relative isn't also specified.

The better solution is for -RelativeBasePath to imply -Relative, analogous to how, with Get-ChildItem, -Depth implies -Recurse.

Update: Turns out that -RelativeBasePath without -Relative does have a use case, albeit only with relative input paths; see comments below.

Resolve-Path $Home -RelativeBasePath /  # -Relative not specified; should be implied

Expected behavior

E.g., on Windows:

.\Users\jdoe

Actual behavior

E.g., on Windows:

Path
----
C:\Users\jdoe

That is, -RelativeBasePath was quietly ignored.

Error details

No response

Environment data

PowerShell 7.4.0

Visuals

No response

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.