On Windows, a directory symlink doesn't behave a like a directory with Get-ChildItem if its target path is a relative path that starts directly with a name #15161
Labels
Needs-Triage
The issue is new and needs to be triaged by a work group.
WG-Cmdlets-Core
cmdlets in the Microsoft.PowerShell.Core module
WG-Engine-Providers
built-in PowerShell providers such as FileSystem, Certificates, Registry, etc.
Note: This is ultimately a duplicate of #15235
PR #8783 brought the ability to use relative paths as symlink targets on Windows.
However, if the target is a directory and the relative path starts with / is just a name (rather than starting with
.\
), the resulting symlink doesn't behave like a directory withGet-ChildItem
.Note that on Unix, as of PowerShell Core 7.2.0-preview.4, use of relative target paths is still fundamentally unsupported - see #15233
Steps to reproduce
Run on Windows:
Expected behavior
With the exception of the directory path in the grouping header, the commands should produce the same output and show the content of the target dir:
Actual behavior
Note how
link1
present as if it were a flle, as if you had calledGet-Item
rather thanGet-ChildItem
on it.Interestingly,
cmd.exe
'sdir
shows analogous behavior, and additionally fails withdir link1\t.txt
, which PowerShell handles correctly.Environment data
The text was updated successfully, but these errors were encountered: