PowerTip: Find All Defined One-Letter PowerShell Aliases

Summary: Learn how to find all the one-letter Windows PowerShell aliases.

Hey, Scripting Guy! Question How can I find all the defined Windows PowerShell aliases that are exactly one letter in length?

Hey, Scripting Guy! Answer Use the Get-Alias cmdlet and choose a one-letter wildcard pattern:

Get-Alias ?


Comments (3)

  1. happysysadm says:

    For sure you know it already, but you can use square to limit the search range to '?' only:

    get-alias [?]

    CommandType     Name                                                Definition

    ———–     —-                                                ———-

    Alias           ?                                                   Where-Object


  2. Ed Wilson says:

    @Happysysadm you are correct. This is because the ? is a wild card character, and you need to tell PowerShell to find the literal character. The following also works:

    PS C:> gal '`?'

    CommandType     Name

    ———–     —-

    Alias           ? -> Where-Object

  3. Aaronis says:

    I have a question that seems related to this, but is a little more in-depth.  I am trying to convert a string of characters.  Each character needs to be the next character in the character map.  For instance, A gets converted to B, 1 gets converted to 2 and ` (that's the tick mark to the left of the "1" key) gets converted to _.  Specifically, I need:

    AbCd12` would get converted to BcDe23_

    Anyone have an idea of how to accomplish this?

Skip to main content