Skip to content

Get-ChildItem doesn't treat directory symlinks as directories on Unix #3723

@mklement0

Description

@mklement0

Note: Applies to Linux and macOS, not Windows.

In most contexts, a symlink to a directory should be treated as a directory.

Get-ChildItem on Unix platform currently treats directory symlinks as files, and therefore doesn't show their contents.

Steps to reproduce (run on a Unix platform)

# Create symlink 'tmpl' to directory '/tmp' in the current dir.
ln -s /tmp tmpl
# Pass the directory symlink to Get-ChildItem
Get-ChildItem tmpl 

Expected behavior

A listing of the contents of directory /tmp

Actual behavior

Something like the following is output; i.e., information about the symlink itself, not its target's contents:

    Directory: /Users/jdoe


Mode                LastWriteTime         Length Name                                                                                                                              
----                -------------         ------ ----                                                                                                                              
d----l           5/7/17   2:35 PM                tmpl                                                                                                                              

Environment data

PowerShell Core v6.0.0-alpha (v6.0.0-alpha.18) on macOS 10.12.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-DuplicateThe issue is a duplicate.WG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions