Skip to content

Powershell Core 6.2.3 does not show Hardlink Target as in previous versions. #11562

@DonFrazier-zz

Description

@DonFrazier-zz

Steps to reproduce

  1. Create a hard link between 2 files
  2. run command gci | ? { $_.LinkType } | Select FullName, LinkType, Target from Powershell V5
  3. run same command from powershell core.
New-Item -ItemType HardLink -Path C:\ -Name cdl.txt -Value C:\ComponentDetectionLog.txt
gci | ? { $_.LinkType } | Select FullName, LinkType, Target

Expected behavior

Target array returns all linked files.

Actual behavior

Target array is empty on Windows PWSH 6.2.3

Environment data


PS c:> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.18362.145
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.145
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1


PS c:> gci | ? { $_.LinkType } | Select FullName, LinkType, Target

FullName                     LinkType Target
--------                     -------- ------
C:\cdl.txt                   HardLink {C:\ComponentDetectionLog.txt}
C:\ComponentDetectionLog.txt HardLink {C:\cdl.txt}

Powershell Core

c:> gci | ? { $_.LinkType } | Select FullName, LinkType, Target

FullName                     LinkType Target
--------                     -------- ------
C:\cdl.txt                   HardLink {}
C:\ComponentDetectionLog.txt HardLink {}

C:> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.2.3
PSEdition                      Core
GitCommitId                    6.2.3
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions