Hacker News new | ask | show | jobs
by arthur2e5 3682 days ago
> Microsoft recognizes this

MS also tried to improve PowerShell by installing the PSReadLine module by default.

Read https://github.com/lzybkr/PSReadLine for instructions on how to make PS a bit more usable.

1 comments

The problem with PowerShell is its syntax, not the extra features of the shell environment. Trying to expose the .Net runtime to the command line is an admirable goal for a scripting language, not a shell. It comes down to this, PowerShell is a catherderal, bash and tools are a bizarre, and that's why they win IMHO. Personally the best shell for any Windows box is to install cygwin and treat it like a Linux box, and on Windows 10 just install Ubuntu and have a real Linux shell.

Windows servers are a dying breed and Microsoft knows it, they've lost that war and are quickly porting everything they can to run on Linux including their .Net runtime and Sql Server; they know they've lost the war, it's only a matter of time.

Most of my big complaints about syntax are related to the shell-ness of PowerShell. For example, when comparing things, I really want to use '<' and '>' rather than -le and -gt.

Generally though, the syntax is different but once you learn it, it's mostly fine and sometimes the text-based nature of Unix commands means you have to do a lot more reg-exing.

For example, compare these two:

    ps -ef | grep "chrome" | awk '{print $2}' | xargs kill
vs

    ps -name chrome | kill 
Of course it's just a matter of preference, but I prefer the the PowerShell version.
Um... pkill chrome, still prefer bash/gnu tools. The bazaar has far more tools, you just have to find the right one.

> and sometimes the text-based nature of Unix commands means you have to do a lot more reg-exing.

That's a feature that has far more upside than downside.

I didn't know about pkill, thanks!

My point still stands. They are different but (IMHO) both excellent. Ubuntu on Windows may eventually reach parity with PowerShell but until then, PowerShell is worth knowing (especially if you follow Microsoft's advice and run servers without the GUI installed).

I agree it's worth knowing, I just don't like it. My prefferred avenue will be porting all .Net stuff to Linux servers and just getting rid of all Windows servers as it becomes possible. .Net is great, C# is great, Windows isn't and I'm glad to see Microsoft's new CEO isn't blind to that reality.
>bash and tools are a bizarre

You mean bazaar. Nice typo though.

bah, yea, thanks.