Skip to content

Sort missing #2246

Closed
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.1

powershell 6.0.0-alpha.9-1

Activity

  1. kilasuit commented on Sep 13, 2016

    @kilasuit
    Collaborator

    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

  2. MaximoTrinidad commented on Sep 13, 2016

    @MaximoTrinidad

    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.

    posh_sort_ubuntu_2016-09-13 08-05-53

    posh_sort_2_2016-09-13 08-17-12

  3. jpsnover commented on Sep 13, 2016

    @jpsnover
    Contributor

    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?

  4. MaximoTrinidad commented on Sep 13, 2016

    @MaximoTrinidad

    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.
    :)

  5. jpsnover commented on Sep 13, 2016

    @jpsnover
    Contributor

    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.

  6. sitano commented on Sep 13, 2016

    @sitano
    Author

    Ryan Yates (@kilasuit)

    $ uname -a
    Linux satana 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    
    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 16.04.1 LTS
    Release:    16.04
    Codename:   xenial
    
  7. sitano commented on Sep 13, 2016

    @sitano
    Author

    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-Object is fine - yes.

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