3 ms·
cmd.exe and batch script are horrible, no argument there. Powershell is a huge improvement, though, and in many ways far surpasses the unix command line enviro
by latkin 11y ago
cmd.exe and batch script are horrible, no argument there.
Powershell is a huge improvement, though, and in many ways far surpasses the unix command line environments. You have real objects at the prompt, with fields and methods, you aren't just wrangling plain text all over the place. Naming and parameter sets are consistent and non-cryptic. Everything is tab-completable (command names, parameter names, [some] parameter values, types, registry keys, paths, history, etc, etc). Writing new shell commands is super simple. Parameter sets for scripts and shell commands are completely declarative, no more manual argument parsing.
Not to say there aren't weak spots: performance and the error-handling model come to mind. Disabling execution of scripts by default, in a scripting environment, also a massive facepalm. There's also the separate-but-related matter of the terminal host environment itself, which has been historically terrible on Windows. At least with Win10 that's finally moving in the right direction.
Anyways, it's a shame people still think "Windows CLI" == "cmd.exe" because most of us moved past that 6 years ago when Win7 included Powershell by default.
- melted 11y agoOne thing I don't get is why does powershell have to be so shitty as a programming language? It literally doesn't look like anything else on Windows. Also, the handling of _interactive_ command line in powershell is atrocious.
- ygra 11y agoHow do you think should it look to be more in line with everything else on Windows? Like VBScript? Batch files? C#? And what bothers you about the interactive command line?
- melted 11y ago>> And what bothers you about the interactive command line? Try zsh with a decent dotfile setup, and you'll undersstand. Until then it's like explaining colors to a color blind person.
- wolfgke 11y agoYour parent poster asked how a command line should look like "to be more in line with everything else on Windows". Not how a good command line under some UNIX looks like.
- melted 11y agoDo you always only read the first sentence?
- ygra 11y ago> Try zsh with a decent dotfile setup ... I'd have to guess what exactly that means and entails, but you're talking about customization to your favourite shell and comparing that to the stock shell without anything on another OS. Don't you think that's a bit unfair?
- latkin 11y ago> so shitty as a programming language > doesn't look like anything else on Windows These are unrelated statements, not sure what you are getting at. Powershell is more than adequate to build one-liners, scripts, tools, and system automation. The syntax is kind of like C# and Perl had a baby. I'd say it stands up quite well against Bash, Perl, or unquestionably Batch. It's not without its warts, and I wouldn't want to build a large production app/service with it, but that's not what it was designed for nor what it claims to target. As I mentioned in my earlier comment, the interactive terminal environment itself has long been quite poor on Windows, and Powershell inherited that. Maybe that's what you mean by "interactive command line"? It's miles better today, though, for 2 reasons - 1. The default Win10 terminal is much improved (resizeable on-the-fly, copy/paste, line selection ... still a ways to go though) 2. Powershell itself now integrates PSReadLine out of the box, which brings all manner of features that were badly needed (undo/redo stack, syntax highlighting, a solid multi-line editing story, optional emacs mode, smarter navigation, it-just-works copy/paste, easily remappable keybindings, more).