Automating the world one-liner at a time…
Marcus Nasarek did a nice comparison of Bash vs PowerShell in Linux magazine HERE. It is only 2 pages but he covers the key elements and has been very fair to it. I appreciate the fact that he took the time to clearly understand PowerShell. In the past, a number of people in the Linux community have assumed they knew what we were doing and did comparisons based upon their assumptions. Those weren't very interesting.
Jeffrey Snover [MSFT]Windows Management Partner ArchitectVisit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShellVisit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
> Powershell Vs Python
That's interesting. Why would you say Python vs Perl?
Jeffrey Snover [MSFT]
Windows Management Partner Architect
Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
> That's interesting. Why would you say Python vs Perl?
what? is this kind of let-us-start-flame-war-day?
Just because someone uses the words "noun1 vs noun2" does not mean "OMG FLAME WAR!". Really, that's in the eye of the beholder. In other words, flame wars are caused by war-like people. But that is beside the point.
Point I wanted to make is that as a fellow 4DOS/4NT user from waaaay back, sure I can sympathize with the comment "Windows should've had this all along". From what I understand from talking to Jeffrey about this, it was a political issue and most definitely not a technical issue. People who...what's a polite way to say this...have not been in the workforce may not understand this concept.
That being said; PowerShell is here and it's here to stay. It knocks the socks off of cmd.exe and vbscript and apples-to-apples I think no other _shell_ comes close to its usability and functionality. When you change that comparison to "scripting language", you are looking at a different thing and the pros and cons and applicability become more complex. Even so, I think Jeffrey and his team have created a new model (OO scripting lang+shell) which sets the new bar for everyone else to plagiarize. :) Case in point--http://pash.sf.net.
Powershell: ssh - some erros (should be 'command not found')...
where is ssh to get to a real unix/linux machine ? It's a JOKE!
I live under a rock, and generate my own electricity by catching electric eels in a bottle; I tell you this so you'll understand why I only just installed PowerShell tonight. It's wonderful.
As a newbie, I found the bash v. ps article helpful, mostly because I'm familiar with bash and wanted some way to get oriented to the new shell. Was the article incomplete? Sure. Was it biased toward PowerShell? Maybe, but that's not important to me.
Thanks for pointing out the article
Use Cygwin instead for windows!
Bash: commands are there, they tend to increase by time with adding of many applications etc. There's a sense of continuity.
Commands are compact e.g. ls, mv, rm etc. This favours speed
Colours are utilised in bash, bash is case sensitive for greater varitiety
PowerShell: This concept is muffled with the developement e.g. commands like dir/w, deltree, etc. So - personally - the sense of continuity between MS-DOS and PowerShell is weaker than various bash shells
Commands are more in a sentence structure verb-noun: e.g. Get-Item. This favours linguistic coherence. Alias is a compromise for covering this gap.
Colours are not utilised (not to my knowledge), PowerShell is not case sensitive for ease of usel
Don Jones sums this up perfectly. Whether you compare it to bash, csh, ksh, zsh, Python or any other. Windows finally has a brilliant shell of its own, to go with its brilliant Operating System. In answer to another question, there is a GUI element also, the aptly named PowerGUI.
It's a shame Microsoft didn't incorporate what they wanted to achieve with Powershell into an existing cross-platform scripting language such as Perl or Python - at least that way we wouldn't have to learn a new language.
For the time being I'll stick to Perl & Python.
My job is to make admins successful not get them to use Powershell. As such, I'm a firm believer in doing what works. If Perl and Python get the job done for you, that's great - why change?
I am looking to replace Cygwin Bash scripting with powershell scripts. The key issue for me is one of performance.... should I assume that for the same types of operation powershell should be faster?
A simple example might be to extract all the source module names and defined routines in those libraries and store them as an XML file.
What's hard to describe to people is that "the shell" doesn't mean just Bash. It could also be Ksh/Korn, C-Shell, Zshell, and a host of others. Any of these are equally supported.
You can "extend" any shell script command with another shell script, which can itself become part of another script.
How do you describe this kind of "open field" flexibility and power to a Microserf? (ja doodz! Powershell is da Bomb!)
When you really get to know Bash, you discover that bash, in and of itself, doesn't really matter. Sure, it's useful, and yes, I'm quite familiar with it, but it's just a small part of a much, much larger system, all of which is 100% open to you for tinkering!
I applaud Microsoft for *FINALLY* coming up with a shell that's actually somewhat useful, 40 years after this task was successfully accomplished in the operating system they first tried to emulate 30 years ago with DOS.
I find this comparison a little weird.
PowerShell seems to be a fully-fledged scripting language, comparable to Python (since it loads objects from different other applications) more than to bash, even though "PS" and "Bash" are both named "shells".
PowerShell doesn't seem to do things simply like bash does. You *need* to learn a whole new scripting language the moment you want to start using pipes and building minimally complex scripts. The fact that bash *only* pipes raw data keeps it simple. When you want OOP, well use the great cross-platform and open source Python scripting language. Standard, with it's thousands of libraries, capable of connecting to loads of applications, to be extended in C, C++, you-name-it-language, and finally build real, fully fledged applications.
It seems to me that PowerShell does fill a hole for Windows admins, but that no Unix sys. admin knowing rudimentary bash and Python will envy.
My question is, having an awsome, well-known, cross-platform OOP languages like Python around, why start off with a new language ? Why multiply the knowledge required for people dealing with large Windows / Unix / Linux / Macs deployments ?
I dislike the way new Microsoftisms must always be introduced, separately from the rest of the world. I think this isn't truly building tomorrow's tech world.
> My question is, having an awsome, well-known,
> cross-platform OOP languages like Python around, > why start off with a new language ? Why multiply > the knowledge required for people dealing with
> large Windows / Unix / Linux / Macs deployments?
"Because we can" (having 90% of computer (l)users under our heel)
"I dislike the way new Microsoftisms must always be introduced, separately from the rest of the world. I think this isn't truly building tomorrow's tech world."
Amen. We know that there's only one reason: money. These Microsoftisims of which you speak, they're a profit drive. Such is the way that they were on DOS for the longest time. They didn't want to upset those who used DOS from the beginning, despite the fact that other OS's were light years ahead of DOS.
So is the way that they create a new 'language'. They create it to hook people, let it drag behind (to keep it comfortable), then to catapult them ahead by light years. Remember VB vs VB.NET? Yeah, same idea.