Welcome to MSDN Blogs Sign in | Join | Help

Bash vs PowerShell

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.  

Enjoy! 

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

Published Tuesday, July 08, 2008 4:40 AM by PowerShellTeam
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# a-foton » Bash vs PowerShell

Tuesday, July 08, 2008 1:06 AM by a-foton » Bash vs PowerShell

# re: Bash vs PowerShell

Hope MS is adding a GUI based on PowerShell to compete with Automator.

Tuesday, July 08, 2008 1:42 AM by anonymous

# re: Bash vs PowerShell

The article isn't entirely accurate about the object pipeline, though maybe it's doing the best it can in the space allowed. It talks about output being converted to objects, when it's the other way around: objects are converted to text for display.  Also, the article says "passing data objects is slightly more complex." I don't agree.  I imagine someone could use PowerShell for quite a while before realizing that it passes objects around, especially if they're expecting traditional shell behavior.  They'd have to read the documentation to know there are objects flying around.

Tuesday, July 08, 2008 9:27 AM by John Cook

# re: Bash vs PowerShell

Maybe Automator can be replicated by Citrix Workflow Studio?

Tuesday, July 08, 2008 4:08 PM by Anonymous

# re: Bash vs PowerShell

I have read this is this seems so biased towards PowerShell. The fact is, I think the author is comparing on features that make no sense in comparing.

The pipe, in Unix, sends the standard output of the command on the left to the standard input of the command on the right. This involves creating two processes and changing standard file descriptors. It is the way Unix is written from scratch to do. PowerShell, on the other hand has "cmd-lets"... Someone please explain me what is this other than builtins in bash? This involves no interprocess communication, as it is executed in the process context of the shell itself.

Everyone I know is just marveled when PowerShell is mentioned, when Unix shell has been capable of doing te same things for more than 30 years. Please, wake up people.

Everyone is missing the point with this PowerShell thing. This is just another shameful plagiarism from Microsoft.

Tuesday, July 08, 2008 7:19 PM by António Trindade

# re: Bash vs PowerShell

the marvel of powershell isn't an anti-unix thing. It has nothing to do with unix. We're delighted to have its capabilities in windows. Ok, unix has had a great shell for years - that hasn't been especially helpful if you need to manage windows. Now windows has a great shell - if concepts were adapted from unix, take it as a compliment. Various unix shells have borrowed from each other for decades - so what if windows' shell borrows some concepts and techniques, too? Don't take thus as powershell vs. Bash; take it as "is windows finally getting a good shell? Let's compare it to a known-good shell and see."

Tuesday, July 08, 2008 11:37 PM by don jones

# re: Bash vs PowerShell

Because I work a lot with *nix and shells, I like the concept of classified data streams. A kind of extension for bash or other shells would be great.

Wednesday, July 09, 2008 3:56 AM by Karl-Heinz

# re: Bash vs PowerShell

Then why is it named "powershell vs bash" uh ?

obviously the review is very short and mentions nothing special , actually. It doesn't mean powershell is bad, but the review definitely is! It looks more like a "let put something about powershell it'll fill our pages".

I especially like the fact that you can use objects, but, is it really useable. Dont know. Guy took the samples from the powershell demos.

What if you cannot have cmdlets from program to program? etc.

Wednesday, July 09, 2008 6:25 AM by bob

# re: Bash vs PowerShell

Don Jones is right. I say this upfront to try not to start a flame war.

I just criticize the PowerShell guys I talk to, because PowerShell is, in fact a shell that Windows should have had for a long time.

However, what ticks me off is the fact that they refuse to recognize that they borrowed a lots of features and ideas from Unix, and that their shell is the best. As usual, I see no technological innovation from Microsoft. In fact, I think they stopped innovating since they launched Windows 95.

Still speaking of shells, has anyone here ever heard of JP Software 4DOS/4NT. I've used these back since I used Windows 3.1. Microsoft should have learnt from them.

Wednesday, July 09, 2008 6:28 AM by António Trindade

# re: Bash vs PowerShell

Hmmm... Not happy with this an article. The conclusion seems to side step the thrust of the article - Bash Vs Powershell. Definitely pulls its punches at the end.

Is calling Bash "plain" and then advocating the use of Python and Tcl/tk - for more complex cases - an admission that Bash now looks old?

At the very least - I'd say this article is a good short introduction to powershell, and Don Jones is right. Windows does finally have a good shell.

Besides... I'm looking forward to the eventual article - Powershell Vs Python.  ;->

Cheers,

  Rob Lancaster

Wednesday, July 09, 2008 6:30 AM by Rob Lancastet

# @ anonymous, Anonymous

How is Visio?

It can cook PoSH scripts and documents with this addon.

http://www.microsoft.com/japan/windowsserver2008/powershell-tool.mspx

...Although it is Japanese based ;)

Wednesday, July 09, 2008 9:25 AM by Smith Catar

# re: Bash vs 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.

For those who actually understand PowerShell or just makes them loose credibility.

Anyway, I'd be interested in seeing (no-follow) links to some of those, just for rubber-necking sake.

Thursday, July 10, 2008 3:08 AM by Mike Schinkel

# re: Bash vs PowerShell

António:  

I think you are being extremely unfair and unwilling to realize what is both unique and powerful about PowerShell.  And this from a web/database developer who has moved completely off Windows+IIS+ASP(.NET)+SQL Server to LAMPhp for the past two years with no looking back.

But I still use Windows on my laptop and I'm AMAZED with how good PowerShell is. You giving PowerShell its due will take nothing away from *nix shells.

Did your mother not read "Green Eggs and Ham" to you when you were but a lad?

Thursday, July 10, 2008 3:12 AM by Mike Schinkel

# re: Bash vs PowerShell

Rob>> I'm looking forward to the eventual article - Powershell Vs Python.  ;->

Those are my too favorite languages, but Python wins out.  Actually, PowerShell would beat Python by a nose, if and only if you could build real web apps with PowerShell...

Thursday, July 10, 2008 3:15 AM by Mike Schinkel

# re: Bash vs PowerShell

I had to comment on this one:

> However, what ticks me off is the fact that they refuse to recognize that they borrowed a lots of features and ideas from Unix

My friend, you have your facts wrong.  We have been, are, and will continue to be, very publicly grateful to all the great efforts that went before us.  We have benefitted greatly from Unix, VMS, AS400, TCL, and many others.  Those guys are my heros!

If you search "SNOVER" and "UNIX" - you get a low signal-to-noise ratio but go search "SNOVER" and "VMS" and you'll find plenty of big hugs and sloppy kisses.

Next - read Bruce Payette's book.  He is absolutely unambigous about this point.  I forget his exact works but it was something to the effect of, "we tried to reuse as much as possible and invent as little as possible".

You can throw rocks at us but you can't say that we aren't open about our respect and admiration for the superstar engineers from other communities.  Well, you can say it but it's not true.

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

Thursday, July 10, 2008 9:07 AM by PowerShellTeam

# re: Bash vs PowerShell

> 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

Thursday, July 10, 2008 9:10 AM by PowerShellTeam

# re: Bash vs PowerShell

> That's interesting. Why would you say Python vs Perl?

what? is this kind of let-us-start-flame-war-day?

Tuesday, July 15, 2008 11:11 AM by yidingz

# re: Bash vs PowerShell

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.

Friday, July 18, 2008 8:25 AM by Hal Rottenberg

# re: Bash vs PowerShell

Powershell: ssh - some erros (should be 'command not found')...

where is ssh to get to a real unix/linux machine ? It's a JOKE!

Friday, July 25, 2008 7:20 PM by alexit

# re: Bash vs PowerShell

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

Friday, August 01, 2008 9:40 PM by Doug Brower

# re: Bash vs PowerShell

Use Cygwin instead for windows!

Tuesday, September 16, 2008 4:38 PM by SomeUser

# re: Bash vs PowerShell

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

Friday, September 19, 2008 8:12 AM by comparative

# re: Bash vs PowerShell

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.

Monday, January 05, 2009 11:05 AM by J.B

# re: Bash vs PowerShell

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.

Wednesday, January 07, 2009 10:28 AM by Patrick Cain

# re: Bash vs PowerShell

@patrick

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?

Best wishes.

jps

Wednesday, January 07, 2009 11:01 AM by PowerShellTeam

# re: Bash vs PowerShell

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.

Regards

Carl

Monday, April 20, 2009 3:00 PM by CarlS

# The hard part...

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.

And then there's the "scripting languages" like Perl, Python, PHP, Ruby, (even javascript!) and a host of others, all of which are also equally supported, and can be used in the stead, or as part of, a shell script.

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.

Tuesday, April 28, 2009 12:43 AM by Ben

# re: Bash vs PowerShell

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.

Tuesday, May 19, 2009 2:50 PM by Alexandre Bourget

# re: Bash vs PowerShell

> 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)

Saturday, July 18, 2009 5:58 AM by Gill Bates

# re: Bash vs PowerShell

"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.

Tuesday, November 24, 2009 4:41 AM by Adam Marchetti

# re: Bash vs PowerShell

@Adam

That all sounds nice and evil and all that let me point out a few things:

1) Profits are a measure of value.  If you aren't delivering any value, you don't have any profits.  As such, being profit-oriented is a very good proxy for answering the question, "Are we doing what customers want?"

2) MSFT has invested multiple 10's of millions of dollars in PowerShell and is making it free to all owners of Windows.  We've spent considerable time and effort to make it available all they way back to Windows XP (Any profit we got from that sale was a LONG time ago).

3) As a team, we are incredibly passionate about solving the problems faced by our customers.  My original approach was to port BASH and UNIX utilities to Windows (You can look this up - I've been very open about this for many years).  The problem is that the UNIX approach is tuned around everything existing in ASCII text files and didn't work on Windows where we have stuff in the registry, AD, WMI, the cert store, etc.  Something new was needed.  We are NOT pushing a technology agenda - we are trying to solve the problems our customers face.  (Actually that isn't entirely true - I am pushing a technology agenda to move a bunch of the glop in those stores into Text files - but that is a different discussion).

You should read Bruce Payette's book PowerShell In Action.  He does a good job explaining our "invent as little as possible" approach and the heavy influence that UNIX had on our thinking.

Cheers.

Jeffrey Snover [MSFT]

Distinguished Engineer

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

Tuesday, November 24, 2009 5:38 AM by PowerShellTeam

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker