Repository navigation
Closed
Description
Steps to reproduce
$ Get-Alias Sort
Expected behavior
CommandType Name Version Source
----------- ---- ------- ------
Alias sort -> Sort-Object�
��
Actual behavior
Get-Alias : This command cannot find a matching alias because an alias with the name 'Sort' does not exist.
At line:1 char:1
- Get-Alias Sort
-
- CategoryInfo : ObjectNotFound: (Sort:String) [Get-Alias], ItemNotFoundException - FullyQualifiedErrorId : ItemNotFoundException,Microsoft.PowerShell.Commands.GetAliasCommand
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.0-alpha
PSEdition Core
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 3.0.0.0
GitCommitId v6.0.0-alpha.9
CLRVersion
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1powershell 6.0.0-alpha.9-1
Metadata
Metadata
Assignees
Labels
No labels
Activity
kilasuit commentedon Sep 13, 2016
Ivan Prisyazhnyy (@sitano) - can you provide the OS this is running on as well please?
Looking at previous Issues & PR's I think that this was done intentionally as per the first note in #929 that references the PR #786 as not to clash with the inbox *nix aliases
MaximoTrinidad commentedon Sep 13, 2016
I can replicate the issue in Ubuntu 16.04.1 Desktop. The alias is missing.
Workaround is to type the full cmdlet: Sort-Object
PS /home/maxt> $PSVersionTable
Name Value
PSVersion 6.0.0-alpha
PSEdition Core
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 3.0.0.0
GitCommitId v6.0.0-alpha.9
CLRVersion
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
In Windows, "Sort" works OK.
jpsnover commentedon Sep 13, 2016
We removed the sort alias on Linux because it is a native utility on that platform and we didn't want to override it. I've been wondering whether we ought to have an "SO" (Sort-Object) alias so that we don't have to give the full name all the time.
Thoughts?
MaximoTrinidad commentedon Sep 13, 2016
Hum! We could just stick to the best practice to use the full cmdlet name to avoid any issues. Leave it to the administrator to create his own alias.
:)
jpsnover commentedon Sep 13, 2016
Maximo Trinidad (@MaximoTrinidad) That is the current answer. The Q is whether the community thinks we should standarize a alias so they can count on it being there.
sitano commentedon Sep 13, 2016
Ryan Yates (@kilasuit)
sitano commentedon Sep 13, 2016
Jeffrey Snover (@jpsnover) Thanks. I just thought maybe it was forgotten. For me main concern was - should I refactor my script to be compatible to Windows PowerShell 5.0, 6.0 or it's just a bug.
Maximo Trinidad (@MaximoTrinidad) Using
Sort-Objectis fine - yes.Sort alias is not available with powershell (core) on mac osx
Sort alias is not available with powershell (core) on mac osx