Linked by Adam S on Tue 8th Jul 2008 12:47 UTC
Talk, Rumors, X Versus Y In 2006, Microsoft released Windows Powershell, a new command line shell that, via cmdlets, scripts, and executables, allow core system administration tasks to be scripted. While this functionality has been available on Unix-type systems for decades, Microsoft's version will almost certainly, within a few years, be available on several hundred million PCs. So how does the Powershell stack up against Linux favorite bash? MSDN links to this Bash vs Powershell article.
Order by: Score:
I don't get PowerShell
by vvsiz on Tue 8th Jul 2008 13:27 UTC
vvsiz
Member since:
2007-10-24

I don't get PowerShell. After years of hype, after a couple of studied books on PowerShell, it is still feels like a overweight, totally-incompatible and awkward way of automating/scripting things.

It can't replace the BAT files.

For simple tasks, I prefer just built-in, established means (bash on Unix, BAT files on Windows). For more advanced things, there is always Perl/Ruby/Python.

Reply Score: 2

RE: I don't get PowerShell
by drahca on Tue 8th Jul 2008 13:38 UTC in reply to "I don't get PowerShell"
drahca Member since:
2006-02-23

From what I understand PowerShell more or less is intended to replace standard BAT files. Maybe you can elaborate a bit as to why it cannot replace BAT files in your view.

While I am no expert on PowerShell, I do like the idea of using introspection to preserve type information between processes connected through a pipe. In Bash you are mostly stuck to using awk to parse the text-only output of some tool, since all type info has been lost.

Does anyone know why they chose the '$' like PHP syntax for variables? Does this facilitate parsing or something? The dollar sign in PHP mostly feels redundant, although the double $$ is sometimes really handy.

Reply Score: 3

RE[2]: I don't get PowerShell
by grfgguvf on Tue 8th Jul 2008 14:05 UTC in reply to "RE: I don't get PowerShell"
grfgguvf Member since:
2006-09-25

One of the goals of Powershell was matching the power of Unix scripting tools.

So they intentionally chose a Perl-like syntax, hence the $.

Reply Score: 0

RE[3]: I don't get PowerShell
by errant on Tue 8th Jul 2008 14:34 UTC in reply to "RE[2]: I don't get PowerShell"
errant Member since:
2006-01-06

One of the goals of Powershell was matching the power of Unix scripting tools.

So they intentionally chose a Perl-like syntax, hence the $.


Unless you have a quote from one of the developers of powershell somewhere I'd really have to question this statement. That sounds a lot like "Oh I wanted to make a car with the power of a Porsche so I copied the horse emblem."

The reason why a lot of early languages used variable identifiers such as the $ was because it made life so much easier from the parser point of view, especially if you are designating a difference between the variable as an object in its own right or whether you wanted the contents of the variable.

Now with regard to why powershell uses it I don't have a good answer, its supposed to be based around the .net framework which doesn't need those type of identifiers and to be honest it feels like if they were constructing a scripting language from scratch they would have made it syntactically comparable to more modern languages.

Reply Score: 2

v RE[4]: I don't get PowerShell
by grfgguvf on Tue 8th Jul 2008 17:55 UTC in reply to "RE[3]: I don't get PowerShell"
RE: I don't get PowerShell
by modicr on Tue 8th Jul 2008 13:44 UTC in reply to "I don't get PowerShell"
modicr Member since:
2005-09-20

>It can't replace the BAT files.

I like 4DOS: http://4dos.z-bg.com/

Reply Score: 3

RE[2]: I don't get PowerShell
by rcsteiner on Tue 8th Jul 2008 17:26 UTC in reply to "RE: I don't get PowerShell"
rcsteiner Member since:
2005-07-12

Me too... And 4OS2, and 4NT, and Take Command, and...

Reply Score: 2

RE: I don't get PowerShell
by BluenoseJake on Tue 8th Jul 2008 14:26 UTC in reply to "I don't get PowerShell"
BluenoseJake Member since:
2005-08-11

I love powershell, it is much more powerful and flexible than batch files, even with the limited branching that batch files support.

I'm well on my way to purging my servers of as many batch files as possible, replacing them with ps scripts, as it gets rid of so many 3rd party tools (like blat). Because it's .NET based, it allows you to write directly to the eventlog, watch directories for changes, access AD, you name it.

Less 3rd party tools mean simpler environments.

Reply Score: 6

So great ! ... Not
by Warnaud on Tue 8th Jul 2008 13:47 UTC
Warnaud
Member since:
2008-07-07

I really love Microsoft Marketing. They are so impressive. They rediscover stuff, (recode also) and explain to anybody they have the best stuff around ;)

Good job guys! Powershell only takes half a minute to launch! the command lines are soooo simple ... --laughing-out-loud ... it's (as always?) not compatible with anything (because 99% of apps on windows have no command line options) It requires the almighty .Net version 3.X framework to work :|

Well in a Vista world, I just can say that Powershell is not that bad ;)

Edited 2008-07-08 13:47 UTC

Reply Score: 4

RE: So great ! ... Not
by WorknMan on Tue 8th Jul 2008 14:05 UTC in reply to "So great ! ... Not"
WorknMan Member since:
2005-11-13

it's (as always?) not compatible with anything (because 99% of apps on windows have no command line options)


For Windows automation, check out AutoIt:
http://www.autoitscript.com/autoit3

And its distant cousin, AutoHotKey:
http://www.autohotkey.com

The former is better for GUI automation. The later is better for scriptable, system-wide hotkeys/hotstrings.

I use them both and like them both ;)

Reply Score: 3

RE: So great ! ... Not
by zimbatm on Tue 8th Jul 2008 14:07 UTC in reply to "So great ! ... Not"
zimbatm Member since:
2005-08-22

Stop bashing Microsoft. Hehehe

Reply Score: 4

Well
by Xaero_Vincent on Tue 8th Jul 2008 14:20 UTC
Xaero_Vincent
Member since:
2006-08-18

Considering BASH works on Windows and PASH (FOSS Powershell) works on *nix. Was a comparison really needed?

Edited 2008-07-08 14:21 UTC

Reply Score: 2

cygwin
by agrouf on Tue 8th Jul 2008 14:24 UTC
agrouf
Member since:
2006-11-17

I use bash on Windows with cygwin. Powershell is useless to me because my customers won't upgrade to Vista anytime soon. Bash works anywhere and scripts are portable. I don't get the point of powershell. It's kind of a new language that nobody knows that offer no real advantage beside being installed by default on Vista. I agree it is way better than BAT (what isn't better than BAT anyway), but why didn't they just even try to use something sort of compatible with the rest of the world... again? Not even compatible with their own systems (older than Vista)? What are they trying to achieve really? Just install cygwin and use bash. It's a no brainer to me.

Reply Score: 1

RE: cygwin
by BluenoseJake on Tue 8th Jul 2008 14:29 UTC in reply to "cygwin"
BluenoseJake Member since:
2005-08-11

I use bash on Windows with cygwin. Powershell is useless to me because my customers won't upgrade to Vista anytime soon.


PS runs on Windows XP/2003/Vista/2008. No need for Vista.

http://www.microsoft.com/windowsserver2008/en/us/powershell-faq.asp...

Edited 2008-07-08 14:30 UTC

Reply Score: 9

RE[2]: cygwin
by modicr on Tue 8th Jul 2008 17:45 UTC in reply to "RE: cygwin"
modicr Member since:
2005-09-20

> 2008

PowerShell does not work on Windows 2008 Server Core -
officialy:
http://dmitrysotnikov.wordpress.com/2008/05/15/powershell-on-server...

Reply Score: 0

RE[3]: cygwin
by BluenoseJake on Tue 8th Jul 2008 18:50 UTC in reply to "RE[2]: cygwin"
BluenoseJake Member since:
2005-08-11

It works on every other version, that's just nickpicking, really. My point was that it runs on XP and 2003, as well as Vista and 2008

Reply Score: 3

RE[4]: cygwin
by agrouf on Tue 8th Jul 2008 20:39 UTC in reply to "RE[3]: cygwin"
agrouf Member since:
2006-11-17

Even so, why didn't they make it somewhat compatible with other shells? I mean all shells use special features, be it ksh, bash or zsh, but they all support plain sh. For instance, GNU autotools' configure script doesn't use extra features and it can run everywhere *except* Windows because ps doesn't support basic shell syntax! Did they really have to invent a new syntax for basic features to support the extra ones when others shells do not have to?

Reply Score: 1

RE[5]: cygwin
by BluenoseJake on Wed 9th Jul 2008 02:41 UTC in reply to "RE[4]: cygwin"
BluenoseJake Member since:
2005-08-11

I don't see why it had to be compatible with other shells, it doesn't run on a *nix and a lot of the underlying toolset is missing, grep, awk you name it. Also, they had a nice new powerful framework to base it on, with all the functionality a good shell needs.

If they had of tried to make it sh compatible, you would have ended up with a system that looks compatible, but would probably fail in such subtle ways as to make it incompatible, and super annoying.

If you really want or need to run a unix cli, why not run Linux or BSD? we need good interoperability between OSs, but not cli syntax compatibility.

Reply Score: 4

RE[4]: cygwin
by StaubSaugerNZ on Tue 8th Jul 2008 21:55 UTC in reply to "RE[3]: cygwin"
StaubSaugerNZ Member since:
2007-07-13

If your scripting language doesn't run *everywhere* then you are wasting your time (unless you a relatively small organisation, in which case any solution would work).

Any big organisation has a lot of all kinds of environments. Plus, whatever you are running on now is not what you'll be running on in the future, so why not future-proof yourself by choosing portable solutions. That is, something other than "fashion-of-the-day" PowerShell.

It makes better business sense to be portable unless you are a "ohh, look, shiny new features" kind-of-guy rather than someone who wants to get stuff done. Plus other (usually less talented) folks be need to be able to maintain your stuff otherwise you'll never be able to be promoted.

Reply Score: 1

RE[5]: cygwin
by BluenoseJake on Wed 9th Jul 2008 01:42 UTC in reply to "RE[4]: cygwin"
BluenoseJake Member since:
2005-08-11

"If your scripting language doesn't run *everywhere* then you are wasting your time (unless you a relatively small organisation, in which case any solution would work)."

I gotta disagree with you there, I can learn more than one scripting language, and there's lots of ways to move information between 2 different OSs. soap, rpc, email, ftp, sms, html, ODBC, blah blah blah. I'm more interested in capabilities and choice, not conformity.

Reply Score: 2

RE[6]: cygwin
by StaubSaugerNZ on Wed 9th Jul 2008 04:08 UTC in reply to "RE[5]: cygwin"
StaubSaugerNZ Member since:
2007-07-13

"If your scripting language doesn't run *everywhere* then you are wasting your time (unless you a relatively small organisation, in which case any solution would work)."

I gotta disagree with you there, I can learn more than one scripting language, and there's lots of ways to move information between 2 different OSs. soap, rpc, email, ftp, sms, html, ODBC, blah blah blah. I'm more interested in capabilities and choice, not conformity.


Be a special snowflake, no one asked you to conform. That is not what was being discussed.

In fact, I wasn't talking about what *you* or *I* might like personally. It isn't "all about you". I'm sure you are very capable of learning many scripting languages. The point was that if you had to pick a single scripting language that less-capable 9-to-5ers had to be trained in (as part of their job, and yes the world is full of these people, and surprisingly enough they do have to do scripting from time to time). It would also have to work everywhere since the biggest environments (banks, government ministries, the military) have all sorts of platforms (usually mainframes and proprietary Unix as it turns out). Then the rational choice is not PowerShell.

So yes, we understand that you personally like PowerShell. However, just because it works for your (possibly small-to-medium) problems doesn't mean that works for everyone and everywhere. Other scripting languages will work everywhere, which makes them far more useful than PowerShell. Sure they don't have the easy Windows integration that PowerShell does, but they can still get the job done (on all platforms). Do you now understand why PowerShell isn't the number one recommendation for general use by many people, since I don't wish to labour the point further?

Reply Score: 1

RE[7]: cygwin
by BluenoseJake on Wed 9th Jul 2008 11:31 UTC in reply to "RE[6]: cygwin"
BluenoseJake Member since:
2005-08-11

Do you now understand why PowerShell isn't the number one recommendation for general use by many people, since I don't wish to labour the point further?


No. I do not understand, as for the first time in 20 years, Windows has a properly supported, properly scriptable command line, from MS. There was no need to make it sh compatible, as if you need sh, use a *NIX. or use some other scripting language on Windows. You have that choice.

You do not have to make Windows become Linux for it to be improved. Sometimes I think people will always complain, no matter what comes along. People complain that Windows doesn't have a proper command line, It finally gets one, and now some complain that it isn't sh compatible. Tough. Windows is not Unix, it's not Linux, and it ain't OS X. If you need Unix, USE IT.

Finally, the university I work at has 15,000 students and around 3000 staff and faculty. We are not a small institution. My problems are not "small to medium" and we do not have "(possibly small-to-medium) problems". We have a very heterogeneous environment, and I have never seen the need for such a level of compatibility, as it's important to be able to exchange data between systems, but mostly, our *nix admins run *nix boxes, and our Windows Admins run Windows boxes, and most times, that's the way it is at most large shops.

You don't have Windows Admins running *nix, it's not what they were hired to do. So your level of compatibility is not needed, and I don't think it is much wanted either. It's these smaller shops you talk about that have people wearing more than one hat, and then, a lot of times, those environments are more homogeneous, and so a compatible scripting environment isn't needed.

So please, don't labour the point any more, because it doesn't hold up. I understand you personally don't like powershell, but grasping at such a weak straw to find something to complain about? Not very helpful, or useful.

Reply Score: 3

Powershell
by Nex6 on Tue 8th Jul 2008 14:43 UTC
Nex6
Member since:
2005-07-06

Powershell, is long needed on windows. once you really start playing with it to do production stuff you start to see the power of it. though just like the artical said, *nix has had most of this stuff already, whats new is two things:

* powershell can pipe/pass objects and text streams
* powershell has a security policy for script exceution, eg; you have have it setup so, only certs from your company will run.

all future, MS admin tools will be built with powershell so going forward, more and more stuff will be scriptable.

exchange 2k7, powershell use is required.


-Nex6

Edited 2008-07-08 14:46 UTC

Reply Score: 10

.. and then some people say....
by eantoranz on Tue 8th Jul 2008 15:16 UTC
eantoranz
Member since:
2005-12-18

.. and then there's this loser here or there that says that *nix is way behind in time or that the file system architecture (everything is a file in a tree) is obsolete. Ain't that lovely to see MS eating their own words after 30 years? Modularity? Improved (???) CLI? I guess Microsoft shills will start praising the goodness of CLIs anytime now. Who knows? Maybe anytime we''ll start to see Power-Shell recipes on the web to solve common Microsoft güindous problems instead of series of pics.

Edited 2008-07-08 15:17 UTC

Reply Score: 1

RE: .. and then some people say....
by Nex6 on Tue 8th Jul 2008 15:26 UTC in reply to ".. and then some people say...."
Nex6 Member since:
2005-07-06

if your a good windows admin, then your used to scripting things. Perl has navtive windows support. you can also use vbscript. hell even python,

the main point being, just becuase your in a windows shop does not mean your brian dead and dont script anything. the only way to effectively maintain a large number of workstations and servers is *with* scripting. i have so many scripts in a few different langages, its not even funny.

and, the other admins, and IT guys i know that work in like enviroments are like wise scriptors. tho to be fair, most of us maintian or have maintianed *nix, so we carry over practices we have learned.



-Nex6

Edited 2008-07-08 15:27 UTC

Reply Score: 2

stestagg Member since:
2006-06-03

'you're'. It's 'you're', not 'your'.

but more seriously, the problem with Microsoft, in this context, is Technologies, IMO.

The *nix world works to the Keep it [the implmementation/interface] Simple principal. This makes the difficulty of solving your problem pretty much linear to the complexity of the problem. Of course, the lack of 'fluff'[typically GUIs] means that the barrier to entry is usually slightly higher with this philosophy

Windows, on the other hand, seems to subscribe to the 'Technologies Technologies Technologies'[Developers, Deverlopers... ;) ] philosophy. They then have to re-create new interfaces to interact with each new technology.
So the barrier to entry is lower, because you are using a customised interface that is simpler to understand than an abstraction, but the moment you try to do something that the interface makers didn't anticipate, then you hit a brick wall. And with MS, this is usually a great big ugly 1000ft brick wall.

Maybe my perspective is skewed, I've just finished writing a spam filter for Exchange 2003. Anyone else thinking of doing so. Dont. Ever.

Reply Score: 1

Nex6 Member since:
2005-07-06

.... never said I was an english major.... ;)

I agree to a point, on Nix, systems interfaces and such tend to be very simple. like bash, its simple useable. and; allows any other shell app to work with each other. the differance between powershell, is MS wanted to also pass arround objects. and interact with dot NET. with strong security built in the "shell" intself.

now, you can not do that and; keep it very simple. there has to be some complexity in it. and powershell has a roadmap, so remoting, and all sorts of stuff is on the roadmap.


microsoft has this thing where they sometimes want to "help you out" as a developer. and that, is where the problem is sometimes.

-Nex6

Reply Score: 3

ari-free Member since:
2007-01-22

what do you think DOS was all about?

But we live in a world where everything is all about visuals and emotion (tv, movies, games) and less about audio/verbal intelligence. So it is reasonable for people to assume that a CLI won't be popular in this environment.

Reply Score: 2

misguided
by backdoc on Thu 10th Jul 2008 01:59 UTC
backdoc
Member since:
2006-01-14

All Microsoft needed to do was to fix command line navigation in cmd.exe. Fixing things like the up arrow history, the tab completion and remembering history between sessions would have made cmd tolerable. If they wanted to create a new command line scripting language, well.... I guess they succeeded. But, if the didn't fix the former, it's not going to do anything for me.

The smartest thing they could have done would have been to just port a native nix shell to Windows and install Perl, Python and Ruby by default. That just seems like it would have been too easy.

Reply Score: 2