What's the best command-line shell: PowerShell vs. CMD vs. Bash

PowerShell is a relative newcomer among command-line shells, but it's easy to see why it's so popular when you compare PowerShell vs. CMD and Bash.

Question: How does the latest version of PowerShell compare to other popular command-line shells, like Bash? What...

about PowerShell vs. CMD?

Jason Helmick: Comparing PowerShell vs. CMD or Bash is like comparing a 2013 Ferrari Spider to a 1969 VW Beetle. Sure they both have tires and a steering wheel, but the Ferrari has better ones. The Ferrari also comes with some amazing capabilities.

All kidding aside, the folks who developed PowerShell had a strong love and appreciation for the ability of LINUX/UNIX (*NIX) shells to take advantage of the object-based capabilities of Windows. By leaning heavily on the success of long-lived *NIX shells and absorbing the best features from them, PowerShell provides a management platform that will make IT pros with *NIX experience feel right at home.

The Microsoft PowerShell team's belief in the importance of interactive management is signified by an object-based pipeline and thousands of commands (cmdlets). PowerShell offers an IT pro the immediate problem resolution on any scale that has been severely lacking in Windows graphical user interface (GUI) management tools. While the learning curve is steep for a Windows-GUI-only admin, it's well worth the climb when you can manage, deploy, inventory and repair as many systems as needed, from anywhere in the world, over PowerShell remoting.

More Ask the Expert answers

Automation of those commands is as simple as copying them to a PowerShell script file -- similar to the old batch files. Any administrator can start automating reoccurring tasks without learning to program, but the scripting language capabilities of PowerShell really start to shine in the hands of a hardcore business scripter. While PowerShell's scripting language is C-based (really C#-based), the experienced *NIX pro will see an influence from other languages like PHP. PowerShell scripts can perform complicated tasks and true Runbook Automation with workflow.

Microsoft has invested heavily in making PowerShell a first-class citizen for management and continues to add PowerShell commands to its enterprise product lines.

The Ferrari and Beetle comparison truly shines when we talk about Powershell vs. CMD. PowerShell outweighs all efforts in the CMD with many important features -- many of which *NIX pros have had for decades -- such as:

  • Consistent command-naming structure (verb-noun);
  • Consistent syntax. No more guessing if it's a dash, slash or question mark;
  • Full object-based pipeline;
  • Simple scripting (automation) for all admins;
  • Advanced scripting capabilities, such as Runbook Automation;
  • The ability to quickly develop scripts into cmdlets for other admins; and
  • PowerShell remoting, which allows an admin to execute scripts anywhere, anytime, on any number of computers.

If you're a *NIX pro charged with managing Microsoft products and operating systems, PowerShell will feel like a comfortable pair of shoes with new soles.

If you're a Windows admin that has been locked into the GUI for most of your career, then PowerShell is a big hill to climb, but one you can climb successfully. It's worth the effort for your future career advancement and a return-on-investment benefit to your company.

Do you have a question for our experts? Submit your own! Email the editors at SearchServerVirtualization.com: nmartin@techtarget.com or janderson@techtarget.com

This was last published in February 2013

Dig Deeper on Microsoft Hyper-V management

PRO+

Content

Find more PRO+ content and other member only offers, here.

Join the conversation

34 comments

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

Which command-line shell do you use most frequently?
Cancel
Never needed CMD in windows unless I needed to kill a program. In linux I use bash for almost everthing, it is just easier then using manially dealling with the FHS.
Cancel
Bash on linux. I have also used PowerShell in Windows, and I like it. It can really come in handy for some scripting.
Cancel
Of course the ultimate command-line processor is TAKE COMMAND, which has a 64-bit version now.
Cancel
I'm no Unix admin, but doesn't bash have much more going for it than CMD.EXE?
Cancel
Seriously? How can put Bash and CMD in the same camp? Without getting in to the boring details, Bash is incredibly powerful whereas CMD is, quite simply, not. I am not that familiar with Powershell so I am not in a position to critique it but I do know CMD and Bash. When I moved from using the former to the latter, my reaction was something along the lines of "Where have you been all my life!" The strength in the fact that it hooks in with so many vendor independent protocols such as SSH for all our network devices, such as Curl for troubleshooting SSL and TCP connections on HTTPS requests to our servers and ngrep for network connections and tcpdump.... etc, etc, Just means I can do it all from one place.
Cancel
Its cool
Cancel
Really, so we are comparing now, apples to cactus? They live in different ecosystems, have different underlying DNA and completely took a different evolution path. Both should do what they were designed for in their realm, although with convergence it becomes tricky, I ofter find myself frustrated on Windows so I install a bash interpreter and associated tools, I'm sure power-shell is powerful for windows that is, but I don't care to use it for business tasks.
Cancel
Bash is good and powerful.
Cancel
Let's see, what can we do with the Command Line Interface? What can we do in Windows? What can we do in Linux? Automated tasks? Remote tasks? Fully automated robots that execute "stuff" ? NIX has been in that culture since day 1, Windows is starting to learn the power of knowing how to speak other languages other than a GUI and extending that power to the final user. Will the user perform their critical backups this way? Will they ever monitor their systems this way? Will they roll-out software updates this way? If you begin answering yes to any of these, then you are a Windows person, don't worry too much, someone will become smarter than you and write a GUI program to do all of those hard-to-do sysadmin tasks, or as the note suggests, you may dare to become THAT smart guy that embarks in learning what *NIX users have known for quite a bit of time. It's all for your benefit.
Cancel
I want to use PowerShell but we don't have it on the still remaining few thousand windows 2003 servers and the few hundred remaining windows xp systems.
Cancel
Tried PowerShell in v1 days, but it wasn't on older systems, and cert requirements were not worth the effort. Also had concerns MS would abandon it. Now giving v3 a try.
Cancel
I wonder WHAT all those CMD users are actually doing with it, I mean, do they actually MANAGE a server like that? I mean ocasionally going into CMD to query something or copy is not that sofisticated is it? I think the angle of this note is misleading and again they succeed it in making it a "contest", by mentioning bash head to head to CMD and PowerShell. But here is a thought for Windows people, DISREGARD the bash chunk and you'll see clearly that the MOST majority is familiar with CMD not so much to PowerShell, but again, I'll bet that they do substantially different tasks as far as complexity goes. Oh well, another hit-honeypot.
Cancel
we did like to worn on CMD
Cancel
Bash rules, PowerShell sucks
Cancel
Ramping up...will certainly overtake CMD in the next foreseeable future
Cancel
I'm surprised that cmd is as high as it is, I use it more when I have to because of my time in bash. Obviously not as powerful, but better than stuck in GUI
Cancel
Bash is the shell, which is simple for automation.
Cancel
Power shell does have a steep learning curve, but it is definately worth it.
Cancel
bash is better suited for linux, as ksh,sh,csh for other unixes.
Cancel
No puedo creer que comparen powershell o cmd con una shell verdadera como bash,sh,ksh,csh...
Cancel
I would never put an enterprise critical app on any Windows box, and would take actions up to dismissal for anyone who does.
Cancel
I am somewhat surprised that you are not including JPSoft's 4nt, or the newer take command shell here.
Cancel
Mostly use the Unix Bash Sheel and Linux Bash Sheel
Cancel
I'm used to CMD; I often use it on Windows computers (clients and servers) for basic tasks. In my day-to-day administration tasks, I rarely need to use PowerShell (at least, until now). I also rarely work on *NIX systems, so I rarely use Bash.
Cancel
The facilities/possibilisties open to *sh users are almost endless
Cancel
where would VBscript fit into this?
Cancel
i use cmd a lot but am so much enthusiastic on the capabilities of powershell
Cancel
I use vbscript actually.
Cancel
bash is the vendor (protocol) universal option because Microsoft don't make my switches or firewalls.
Cancel
Can Powershell be used on Windows 7 systems - (A) locally and (B) remotely?
Cancel
Powershell has potential, but it has lots of limitations too, mostly dealing with syntax (at least to an ex-programmer-turned-admin). Bash and cmd are both well-trod, so there are tons of actually GOOD examples of how to do things with them. ANY of them are better than VBScript.
Cancel
I'm new to all this. So I decided to go with PowerShell. Too bad all these command line shells are limited to their respective operating systems.
Cancel
I use dos with unix tools. There are not enough useful Powershell examples to tempt me over
Cancel

-ADS BY GOOGLE

SearchVMware

SearchWindowsServer

SearchCloudComputing

SearchVirtualDesktop

SearchDataCenter

Close