Linux Bash vs. Windows PowerShell
31–40 of 93 posts
Re: Linux Bash vs. Windows PowerShell
#32I dev on a Mac and do a lot of 'quality of life' scripting with Bash. I recently had to do something on a PC and figured I'd try out Powershell. I have to say, it was a joy. Dealing with objects instead of text is so refreshing, it really is a game changer especially when you start integrating with COM (e.g. excel). The only things I found worse: 1 - error handling doesnt bubble in the same way. e.g. I can't do an eq…
Re: Linux Bash vs. Windows PowerShell
#33I think PowerShell doesn’t really compete with Bash, it competes with Python, Perl or the like. And I haven’t found it to be superior in that aspect other than at integration with Windows system stuff.
Re: Linux Bash vs. Windows PowerShell
#34If you need crossplatform scripting and will install a runtime, why go powershell or bash ? Something like ruby or python seems more adpated.
Besides, Powershell comes with OS.
Re: Linux Bash vs. Windows PowerShell
#35I hate how long the PowerShell comand names are. Yes they are sensible but arg. Eg grep vs Select-String as the article mentions.
Re: Linux Bash vs. Windows PowerShell
#36Article might be more successful if it demonstrated some of the advantages of PowerShell, such as returning the output as objects instead of lines, and what you can do with them as a result. I'll admit to being in the "Bash is what I know, I'll just install WSL/Cygwin/PuTTY on my Windows workstation and be done with it" crowd. PowerShell is on my bucket list of things I need to learn at some point, or at the very lea…
I made a Bash script for HN, and while I’m the furthest thing from an expert in Bash (I’m a newb), I was impressed by a contribution made with a port of the script to Powershell[1]. You can see the same script compared in Bash, Powershell and Python! Prior to this I had never really explored PS, but it is definitely cool Shameless Plug: [1] https://github.com/realrasengan/autobahn
I use Bash for all my scripting needs, on both Windows and Linux - I just can't get over my dislike of Powershell's verbose syntax and Pascal-Snake-Case naming!
But some things are difficult or finicky in Bash; maybe I should stop putting off learning Python...
Re: Linux Bash vs. Windows PowerShell
#37I dev on a Mac and do a lot of 'quality of life' scripting with Bash. I recently had to do something on a PC and figured I'd try out Powershell. I have to say, it was a joy. Dealing with objects instead of text is so refreshing, it really is a game changer especially when you start integrating with COM (e.g. excel). The only things I found worse: 1 - error handling doesnt bubble in the same way. e.g. I can't do an eq…
At the top of the script is the closest I fount to `set -e`
Re: Linux Bash vs. Windows PowerShell
#38This is a pretty poor comparison of the two, especially once it gets into the syntax, of which most of the Bash examples are broken in some way. There’s also a lot of just straight errors, such as mentioning “true” and “false” “values” in Bash, which don’t exist—the userland toolset includes “true” and “false” programs that can be used to inject desired exit code status into some logic flow, but there is no real conc…
I have just seen scroll size and imediatelly closed it.
Re: Linux Bash vs. Windows PowerShell
#39The real difference is: in any reasonable bash script there will be a significant amount of awk, cut, tr and other commands to munge the output of one command into the input expected by the next. In PowerShell that totally goes away.
To be more evil, your text parsing wont work on all platforms, and you probably didn't od it right or you need to be Reg Exp master which is something I rarely find even in senior devs.