Intro
- Powershell introduced by Microsoft in 2006 for Windows OS.
- Since earlier versions, Powershell provides predefined aliases for commands. For example, alias
sort
for commandsort-object
. - Microsoft has released Powershell for Linux in 2018 (Powershell 6.1+).
- Powershell 6.1+ for Linux contains predefined aliases, but the
sort
alias is not included in the standard package. Powershell 6.1+ for Windows still containssort
among the other aliases.
Questions
- Do you think it is possible to use
sort
in Powershell answers? - is it need additional comments in answers to use
sort
? - How have similar cases been solved for other languages?
Thanks
2 Answers 2
Yes
This sounds perfectly fine to me. There are a couple similar questions. For example...
And there are plenty of answers that work in Linux but not Windows, or vice-versa. In PPCG, a language is defined by its implementation, so as long as it works on one implementation (in this case, Windows Powershell 6.1), then it's a valid submission.
It would probably be best for you to mention if an answer is Windows specific. Either like this:
Powershell, 1 bajillion bytes
<some code>
Doesn't work on Linux because it uses the
sort
alias.
Or
Windows Powershell 6.1, 1 bajillion bytes:
<some code>
The same idea applies if you wanted to use the Linux specific aliases.
Yes
On PPCG, we define languages by their implementation/interpreter. So, as long as the sort
alias exists in any one version of Powershell and an interpreter exists for that version, it's fair game.
The only requirement then is, when posting solutions that use sort
, to include the version name/number with the language name.
sort
, but also for thels
andman
aliases. \$\endgroup\$sort
and the like. \$\endgroup\$