2
\$\begingroup\$

Source answer

Intro

  • Powershell introduced by Microsoft in 2006 for Windows OS.
  • Since earlier versions, Powershell provides predefined aliases for commands. For example, alias sort for command sort-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 contains sort among the other aliases.

Questions

  1. Do you think it is possible to use sort in Powershell answers?
  2. is it need additional comments in answers to use sort?
  3. How have similar cases been solved for other languages?

Thanks

\$\endgroup\$
3

2 Answers 2

6
\$\begingroup\$

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.

\$\endgroup\$
3
\$\begingroup\$

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.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .