Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Powershell? hahaha!


Powershell is a very powerful language. It has every features python has, and then some.

Of course it has many drawbacks too - Closed source, off-putting syntax for some people, dependency on .net - but it's quite impossible to find an equivalent on linux (python doesn't even come close for scripting and piping stuff), and i find myself missing it sometimes.


Well it's probably the best modern shell (since it's objects being piped, you don't need regexs everywhere like currrent gen unix shells), but it really depends if he was attempting something command-linish or not.


It may be the best modern shell if you like OO and if you can tell me what's the difference to, say, an interactive Python session.

I think the most flexible kind of interfacing between independent apps will always be text based. It makes no sense to impose some typed object model onto those interfaces. That just causes more dependencies which is exactly what you want to avoid for that type of integration.


Well, first, the object-orientedness of powershell is just one more layer. You can work on a text-based basis in powershell, just send out strings :P

On the other hand, this very feature of powershell is amazingly powerfull, and allows you to lay out some things fare more logically than you could/would do in a text based shell, not to mention purely interface with more complex applications written in .net flawlessly (like doing a small GUI for your script in five seconds for example).

When you work with text, you're basically reinventing parsing at every pipe, and that, too makes no sense at all, for certain applications.

EDIT: What you said just reminded me of something on dadgum http://prog21.dadgum.com/74.html.


If all programs I'm connecting are .NET based and hence share a common type system, why would I need a shell script at all? I don't see the point of inventing yet another programming language for that purpose. I could just as well use any existing .NET based language to do the same thing.

Apart from that, the power of the Unix shell isn't primarily the shell scripting language itself. It is the design of the programs it connects. You need small programs that do one thing. Windows software isn't built like that (neither is Java software by the way), so it doesn't matter much what the quality of the shell is I think.


>If all programs I'm connecting are .NET based and hence share a common type system

Well to set it apart from C#/F#, Powershell is dynamically typed, so you don't have to bother with the types of your objects.

To set it apart from Ironpython/ruby, or any other dynamic languages on the CLR, Powershell is made to be a shell scripting language. It means that tasks common in system administration are made to be simplified, that command to deal with the filesystem, processes, services and anything else on the system are builtins, and that it interacts very well with other apps, all things that are definitely not true with python or ruby. ipython brings you an inch closer, but with powershell you have the full thing.

> Apart from that, the power of the Unix shell isn't primarily the shell scripting language itself. It is the design of the programs it connects. You need small programs that do one thing.

Well those programs (grep, awk, sed, cat, and many others) are meant to be used in a shell environnement. With powershell, most if not all of the utility of those commands is replicated in equivalent commands. Those are not binary executables, but built-ins commands. But you can add new ones very easily, by coding them in powershell itself and adding them to your environnement in a way that has been thought out for that very purpose. I see no diminution in power, quite the contrary.

But i see no real interrest in preaching to somebody who has already made up his mind. All i can say is, if you have the occasion to try it extensively, you really might change your mind on the subject :)


Your compare shell apps to cmdlets, which indeed are single function apps (like get-proces aka ps).


ps myprocess | kill

Notice the lack of reg exs - no grep or cut. Its also far shorter than the equivalent python session. You'd know that if you spent about 10 seconds on wikipedia, but im happy to reproduce. There are object pipeline shells on unix but many of the projects are dead.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: