I would be nice to have a short alias for Select-Object as there is for Where-Object (?) and ForEach-Object (%). Seems natural that Select-Object would have one as frequently as it is used. All three of these are my bread an butter most days. I'd be open to any non conflicting single symbol character.
I've always thought that the use of ? and % were 2 of the worst decisions made in the early days of PowerShell. Adding another one compounds the confusion. if you want a single character alias its easy to add one but why stop with select-object. Shouldn't the same be done for sort-object?
@RichardSiddaway Production guys need sometimes to do things quickly in the consolehost. I don't see any character available to be aliased.
Maybe caret?
Two things
sel聽then tab will give you select - - that's pretty quick
the use of ? and % are confusing to many newcomers which is why I've never liked them. Getting people to stop using them in scripts can be painful.
I know people in production need to do things quick - I spent 25 years working in IT production environments.聽I think its just as important to avoid bad habits that can actually hurt
@RichardSiddaway I don't like them in scripts either but at console it makes sense to me.
All three of these are my bread an butter most days.
@thezim I'm curious about your usage of it. I hardly use Select-Object
10% of the time that I use %
and ?
. What's the scenarios that it solves for you?
@vors usually it is something like this where I would prefer the line to not wrap, especially with expressions. I'm not saying a select alias would eliminate a wrap but it would help.
gci -recurse -file -filter *.cs -path c:\source | sls "sometext" | select Path,LineNumber,Pattern,IgnoreCase,@{Name="Line";Expression=@{$_.Line.Trim()}} | export-csv c:\temp\found.csv
Ah, with export-*. Makes sense.
@SteveL-MSFT Should we have a conclusion from powershell-committee? Won't fix?
I don't think this needs a discussion from the Committee. Seems like a nice to have and individuals can create aliases for themselves. In the future, if we can get telemetry on cmdlet usage (interactive vs script), perhaps we can add additional aliases at that time if warranted.
Most helpful comment
@RichardSiddaway I don't like them in scripts either but at console it makes sense to me.