Skip to content

Sort-Object reports error "unexpected {" #92

@tomasbruckner

Description

@tomasbruckner

This code

Get-ChildItem ".\" -Recurse |
    Select-Object @{n = '1'; e = { $_.Name.Split(".")[0] } }, @{n = '2'; e = { $_.Name.Split(".")[1] } }, @{n = '3'; e = { $_.Name.Split(".")[2] } }, @{n = '4'; e = { $_.Name.Split(".")[3] } }, @{n = 'full'; e = { $_.Name } } |
    Sort-Object { [int]$_.1 }, { [int]$_.2 }, { [int]$_.3 }, { [int]$_.4 } |
....

Show "unexpected {" but it works fine

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is neededparserIssues related to PowerShell script parsing

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions