Please feel free to provide feedback or file bugs here.

Add easy column aliasing for Select-Object

In SQL, columns can be aliased as simply as this

Select GivenName as FirstName, Surname as "Last Name"

With PowerShell, I generally refer to a webpage or reference guide for a refresher on the syntax for Select-Object aliasing.

Select-Object @{Name="Surname";Expression={$_."Last Name"}}, @{Name="GivenName";Expression={$_."First Name"}}

I understand that Expressions are Powerful, but SQL supports similar power as seen in this example

Select GivenName AS FirstName, Surname AS 'Last Name' FROM names

SELECT NameChange =
CASE
WHEN Surname = 'LeMaire' THEN 'The Mayor'
END
FROM names

Please add easier column name aliasing for Select-Object.

18 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Chrissy LeMaire shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base