Linux Bash vs. Windows PowerShell
vedipen.com
Linux Bash vs. Windows PowerShell
1–10 of 93 posts
Re: Linux Bash vs. Windows PowerShell
#2edit: "if" example also misses a semicolon before "then".
Re: Linux Bash vs. Windows PowerShell
#3Known Issues for PowerShell on Non-Windows Platforms
https://docs.microsoft.com/en-us/powershell/scripting/whats-...
Re: Linux Bash vs. Windows PowerShell
#4Re: Linux Bash vs. Windows PowerShell
#5Why isn't this false? Is it doing type checking instead of a value comparison?
Re: Linux Bash vs. Windows PowerShell
#6There’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 concept of a Boolean type.
Overall, if you’re going to provide a rundown of how x and y compare, you should probably give real examples, not just a laundry list of “instead of grep, we use select-string; instead of sed we use -replace”. But how do you use them? I worked with Powershell some over a decade ago, but this article doesn’t give enough info for me to understand what to do with the information it’s providing. And given the errors in describing how Bash works, I’m skeptical that the Powershell examples are syntactically correct either.
Re: Linux Bash vs. Windows PowerShell
#7> "sample1" -eq "sample2" -> True Why isn't this false? Is it doing type checking instead of a value comparison?
Re: Linux Bash vs. Windows PowerShell
#8The 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.
Re: Linux Bash vs. Windows PowerShell
#9Re: Linux Bash vs. Windows PowerShell
#10I'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 least just get a RosettaCode cheatsheet of common stuff I do in bash and how to do it in PowerShell for when I'm stuck on remote Windows servers.