Skip to content

Get-ChildItem (-Recurse) and (-Recurse -Name) return inconsistent #20129

Closed

Description

@OwnageIsMagic
Get-ChildItem ../.. -Recurse -Depth 1 -Name | gm -View Extended

Get-ChildItem ../.. -Name | gm -View Extended

   TypeName: System.String

Name          MemberType   Definition
----          ----------   ----------
PSChildName   NoteProperty string PSChildName=.clang-format
PSDrive       NoteProperty PSDriveInfo PSDrive=C
PSIsContainer NoteProperty bool PSIsContainer=False
PSParentPath  NoteProperty string PSParentPath=Microsoft.PowerShell.Core\FileSystem::C:\source\runtime2
PSPath        NoteProperty string PSPath=Microsoft.PowerShell.Core\FileSystem::C:\source\runtime2\.clang-format
PSProvider    NoteProperty ProviderInfo PSProvider=Microsoft.PowerShell.Core\FileSystem

returned strings missing extended properties.

Was also mentioned here #9119 (comment)

UPD:
#8995 suggests that maybe it should not be fixed as it would negatively affect perf.

Activity

  1. jhoneill commented on Aug 17, 2023

    @jhoneill

    From the help

        -Name <System.Management.Automation.SwitchParameter>
            Gets only the names of the items in the location. The output is a string object ...
    

    Which suggests that even those added properties should not be expected .

  2. OwnageIsMagic commented on Aug 20, 2023

    @OwnageIsMagic
    Author

    duplicate of #9120

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions