3 ms·
... Neither? It's a superior alternative to cmd.exe. bash has never been a serious contender for Windows. Before PS you always wrote .bat scripts for cmd.exe (
by Arnavion 5y ago
... Neither?
It's a superior alternative to cmd.exe. bash has never been a serious contender for Windows. Before PS you always wrote .bat scripts for cmd.exe (or .vbs for cscript.exe if you were really depraved). Nobody except Linux-first FOSS authors would expect Windows users to have cygwin / msys / mingw32 installed.
PS gave us a saner choice, though we would still usually bundle it with a .bat wrapper, just to a) make it double-clickable and b) set `-ExecutionPolicy Unrestricted`.
If you're asking "is PS better than bash", then sure it's better in some ways and worse in others, but that question only makes sense on Linux where bash is actually an option.
- einpoklum 5y agoBut instead of coming up with PS, it would have been pretty straightforward to just install bash on Windows. Someone chose to go the PS way rather than the bash way. My question is what the reason was for making this choice. > Nobody except Linux-first FOSS authors Bourne shell and its predecessors and successors are traditional and common on most computer systems since the early 1970s (starting with the Thompson shell in 1971; see: https://en.wikipedia.org/wiki/Unix_shell https://en.wikipedia.org/wiki/Unix_shell ) so, I would argue actually the other way around. "Everybody except Windows-only closed-source authors would expect people to have bash or similar shell working." The question is, why go for PS instead of adopting a regular shell.
- Arnavion 5y agoI'm really not sure what your point is. >Someone chose to go the PS way rather than the bash way. Are you asking about users or the Microsoft employees who work on Windows? Users don't want to install either bash or PS, which is why before PS existed all scripts were written for cmd.exe which was guaranteed to be available. Microsoft employees would have no benefit from adding bash to Windows given its license, and PS integrates better with the OS anyway. The author of PS is already on record that one of the original reasons was to integrate better with WMI etc [1]; given how hard / impossible it is to munge the output of ls etc in bash it should be no surprise than an object-based shell with saner expansion rules works better. >> Nobody except Linux-first FOSS authors >Bourne shell and its predecessors and successors are [...] You don't have to give me a history lesson. What you said has nothing to do with the fact that the only people who expected Windows users to have bash were Linux software authors, because their software only supported being built by bash scripts (and required make, configure, perl, what have you). Windows software itself, whether open or closed source, was built using cmd.exe scripts or VS project files. [1]: https://stackoverflow.com/a/573861/545475 https://stackoverflow.com/a/573861/545475
- raverbashing 5y agoLet's be real honest here, bash sucks. "common on most computer systems since the early 1970s" yes, that's exactly the problem, it still thinks spaces on filenames are an "exception", just as a start. It knows about lines but barely. PS has native json support.
- sidpatil 5y ago> most computer systems since the early 1970s How are you defining "most"? Back in those days there was much more diversity in the computing landscape.
- jodrellblank 5y agoJ. Snover started out bringing Unix (VMS) shell to Windows, and it isn't a good fit. Everything isn't text and so the Unix shell tools are pretty limited. So they made something which is a good fit for Windows everything-is-an-API instead. > "The question is, why go for PS instead of adopting a regular shell." The question is, why stick with 1970s stuff when you can have progress?
- x0n 5y agoSimply because on Unix, configuration is text files; bash and the gnu utils work with text. In Windows, it's an API driven O/S; powershell uses objects, but will coerce output to strings to allow text parsing if needed.