Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've been wondering if Windows Powershell is as powerful and efficient as Linux' terminal. People offline tell me, without explaining much, that Windows Powershell is an attempt to make UNIX administrators feel more comfortable using Windows. But I guess, they will be comfortable only if it has (or almost) same efficiency.

share|improve this question

closed as primarily opinion-based by Mark, Ƭᴇcʜιᴇ007, surfasb, terdon, Daniel Beck Jan 26 at 17:55

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

3  
That's hard to answer, because there is not THAT Linux shell. There are many shells commonly used on Linux (or generally *nix systems). The most used one is bash, so you may want to ask about that.<br> Also "powerful" is very opinion based. –  Kritzefitz Jan 26 at 17:02
1  
People offline tell me ... that Windows Powershell is an attempt to make UNIX administrators feel more comfortable using Windows. Those people have neither used Unix or Powershell. –  surfasb Jan 26 at 17:23
    
I'd say that PowerShell is an acknowledgement from some areas of Microsoft that they messed up by not having a powerful shell available. It does not at all copy the style of UNIX however. To know PS, you really do well to understand a bit about how Windows works and how .NET works. –  Julian Knight Jan 26 at 18:08
    
BTW, Microsoft did have a BASH shell available that was part of a migration toolkit supposed to help people move from UNIX to Windows Server. –  Julian Knight Jan 26 at 18:09

2 Answers 2

Well, your first problem is that you are comparing a shell (Powershell) to a terminal. In Linux, a terminal is something that sends and receives character-based I/O and is assumed to have an interactive user behind it (in other words, it's the GUI application used to contain a shell). One of the most common shells run within Ubuntu's Terminal is bash, but there are others.

People offline tell me, without explaining much, that Windows Powershell is an attempt to make UNIX administrators feel more comfortable using Windows.

Really, the correct thing to say is that Powershell is Windows exposing much of the WMI, COM and .NET object model in an interactive and scriptable command line environment - and that this command line environment continues to borrow many of the concepts - such as pipelines and I/O redirection - from UNIX shells, just like the old DOS (2.0 and up) command.com and cmd.exe did. Pipelines work with objects in Powershell. You can do things like create HTML and possibly Excel spreadsheets on the fly if you knew enough. It's certainly an upgrade/replacement from the old cmd.exe shell which hasn't changed much from NT 4.0.

Regarding the syntax, it's less like the UNIX shells (although finally none of the cmdlets use / as a switch or parameter indicator), but there are many aliases to classic Unix commands - such as entering ls in a Powershell window will work like dir. But these are just aliases ("Get-Alias" lists these?)

Regarding the capability of Powershell, you really had similar capability, in a scripted-only fashion, from VBScript and Cscript - though both of these predate .NET.

One thing UNIX people do not have to do when using bash most of the time is to be intimately familiar with a programmer's or object's possibly very elaborate object model, which is required for many advanced and simple Powershell tasks. But this is only possible because there is a clear convention of straight text output for many standard POSIX commands. Windows has not had this tradition - it has seemed to prefer you use an mmc console for adminstration tasks, with commands added here and there over the years. Furthermore many well-known UNIX utilities are complex and require some study before use - rsync, wget, and many others. Efficiency is probably a function of how well one knows the tool they are using more than anything else.

share|improve this answer
3  
+1 for mentioning that PowerShell exposes .NET to the console & as a scripting host. It exposes the power of many key Windows libraries to be used in scripting. The use cases between the two may be similar, the style is totally different. –  Julian Knight Jan 26 at 18:06

Windows Powershell and Unix shell are two different things with advantages in both.

Unix (shell) has a philosophy that every thing is a file. The input and output of a unix command can be accessed like a file. This make chaining command really simple and reusing the output of one command by another is the power of unix shell.

With Windows Powershell, as far as i know, everything is object. You can pass the result of a command to another as an object. This can be really powerful, but it does not have the simple concept of Unix.

I don't believe that Powershell is as efficient as a Unix shell, but others believe that it is.

But the comparison is moot because Windows is not a *nix system, thus *nix concepts don't apply. Compared to MS DOS, Powershell is a great improvement.

share|improve this answer
    
The everything is a file has nothing to do with the shell, it is a kernel thing. –  terdon Jan 26 at 17:31
1  
True, but it impacts on how the unix shell is designed. –  Biapy Jan 26 at 17:38
    
@terdon: That's right, but the shell works nicely with this. Because it's still the shell that recognizes symbols like |, < or >. –  Kritzefitz Jan 26 at 17:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.