Skip to content

Default Get-Item output does not list name of symlinks if the path ends in a path separator ("/") #10633

Closed

Description

Presumably closely related to #10630

Steps to reproduce

On Linux (also verified on macOS; haven't tried on Windows)

# OK; symlink /proc/self is properly represented in the default output, and shows
#  link target path too.
Get-Item /proc/self | Out-String | Should -match self

# BROKEN: Appending "/" makes the Name column blank.
Get-Item /proc/self/ | Out-String | Should -match self

Note the use of Out-String so as to expect the default output formatting, which is where the problem lies; by contrast, accessing the Name property explicitly, with, say, Format-List Name, works fine.

Expected behavior

The tests should pass.

Actual behavior

The 2nd test fails, because the Name column is blank:

Expected regular expression 'self' to match '
    Directory: /proc
Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
l----           9/26/2019  2:58 PM                
', but it did not match.

Environment data

PowerShell Core v7.0.0-preview.4

Activity

  1. added
    Issue-Question
    on Sep 26, 2019
  2. added
    Issue-Bug
    WG-Engine-Providers
    and removed
    Issue-Question
    on Jan 15, 2021
  3. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  4. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  5. added
    Resolution-No Activity
    on Nov 16, 2023
  6. microsoft-github-policy-service commented on Nov 23, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

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

    Issue-BugOS-LinuxOS-macOSResolution-No ActivityWG-CmdletsWG-Engine-Providers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions