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

asked Jun 28, 2019 at 17:11
\$\endgroup\$
3
  • 1
    \$\begingroup\$ This is how Powershell 6.2.1 behaves in Ubuntu 18.04.2 LTS for clarity, not only for sort, but also for the ls and man aliases. \$\endgroup\$ Commented Jun 28, 2019 at 19:28
  • 1
    \$\begingroup\$ See this issue and this pull. Dennis, I think, made the profile modification from issue 567 so that TIO works for sort and the like. \$\endgroup\$ Commented Jul 8, 2019 at 14:15
  • 1
    \$\begingroup\$ An example of it working on TIO (with its version table) along with Dennis' pre-loaded aliases \$\endgroup\$ Commented Jul 12, 2019 at 16:44

2 Answers 2

7
\$\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.

answered Jun 28, 2019 at 17:43
\$\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.

answered Jun 28, 2019 at 17:46
\$\endgroup\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.