Skip to content

Sort is incorrect for strings containing the '-' character #3425

@iSazonov

Description

@iSazonov

From UserVoice https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/18580849-bug-sort-is-incorrect-for-strings-containing-the

Steps to reproduce

"somefile1","somefile2","s-abc","s-little","s-foo","s-poo","s-wtf" | sort

Expected behavior

s-abc
s-foo
s-little
s-poo
s-wtf
somefile1
somefile2

Actual behavior

s-abc
s-foo
s-little
somefile1
somefile2
s-poo
s-wtf

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSVersion                      6.0.0-alpha
PSEdition                      Core
BuildVersion                   3.0.0.0
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion      2.3
CLRVersion
WSManStackVersion              3.0
GitCommitId                    v6.0.0-alpha.17

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions