Linked by Thom Holwerda on Thu 25th Jan 2007 00:43 UTC
Microsoft "Once upon a time, when DOS walked the earth, the command line was the primary user interface for most of our computers. Then, Windows came along, and Microsoft seemed set on leaving the command prompt to dry up and wither into obscurity. Fortunately, Microsoft has again turned its attention to the command line and, in so doing, has produced one of the most compelling new Windows features eWEEK Labs has ever had the pleasure to test: Windows PowerShell."
Order by: Score:
v Once upon a time
by vlado on Thu 25th Jan 2007 01:11 UTC
RE: Once upon a time
by ari-free on Thu 25th Jan 2007 01:40 UTC in reply to "Once upon a time"
ari-free Member since:
2007-01-22

why in the world would someone want to learn bash, one of the most unintuitive shells ever created.

Having said that, powershell also seems to be behind the times in its anachronistic cmd.exe like UI

Reply Score: 3

RE[2]: Once upon a time
by gregorlowski on Thu 25th Jan 2007 02:51 UTC in reply to "RE: Once upon a time"
gregorlowski Member since:
2006-03-20

Bash is at once a shell interpreter (in its compiled form) and also a language. I think it doesn't really make sense to call a language unintuitive. Whether or not a language is intuitive is determined by the user's familiarity with similar languages, etc.

I believe that bash is very intuitive if you're fluent in ksh, for example. However, if you've never used a shell then it is not intuitive at all. Likewise, if you grew up using VBScript, bash is not intuitive (but the inverse is also very true).

Once you learn how to pipe together commands and the unix shell way of thinking, I think working in bash is very intuitive. I routinely pipe text through sed, awk, cut, tac... I construct lists of files with find, iterate over them in bash for loops or with xargs.

I like the extensions that GNU added to bash over plain old sh, and when I'm working in ksh on an AIX system, I miss all the power of gnu readline and bash's special variables and keybindings like $! or !cmd:p, etc.

Some people will tell you that bash is bloated, and I often will write a shell script so it does not NEED bash and can run on something leaner like ash or dash, but for an interactive shell bash cannot be beat. bash is the best interactive command line tool that exists today for shell work, period.

Reply Score: 5

RE[3]: Once upon a time
by abraxas on Thu 25th Jan 2007 05:07 UTC in reply to "RE[2]: Once upon a time"
abraxas Member since:
2005-07-07

Some people will tell you that bash is bloated, and I often will write a shell script so it does not NEED bash and can run on something leaner like ash or dash, but for an interactive shell bash cannot be beat. bash is the best interactive command line tool that exists today for shell work, period.

I beg to differ. ZSH is the best shell. ;)

Reply Score: 3

RE[3]: Once upon a time
by Messere on Thu 25th Jan 2007 06:48 UTC in reply to "RE[2]: Once upon a time"
Messere Member since:
2006-10-12

"but for an interactive shell bash cannot be beat. bash is the best interactive command line tool that exists today for shell work, period."

Fish (Friendly Interactive SHell: http://roo.no-ip.org/fish/ ) is a really nice attempt to build user friendly command line (especially for novice users) and polish some Bash rough edges.

Reply Score: 1

RE[3]: Once upon a time
by ari-free on Thu 25th Jan 2007 03:08 UTC in reply to "RE: Once upon a time"
ari-free Member since:
2007-01-22

Just from what you wrote:
sed, awk, tac...xargs...keybindings like $! or !cmd:p

can you really say any of this makes sense in any language known to man?

And piping isn't just for unix. VMS DCL also has pipes (ok and also lots of $'s) . But it was designed for the most part to be consistent, syntax checking and "user-friendly" and I don't mean gui clicky grandma user-friendly.

Reply Score: 2

RE[4]: Once upon a time
by FooBarWidget on Thu 25th Jan 2007 10:23 UTC in reply to "RE[3]: Once upon a time"
FooBarWidget Member since:
2005-11-11

"can you really say any of this makes sense in any language known to man?"

And you think your grandmother can make sense of a line that looks like "get-childitem | measure-object -property length -sum"? Face it: to the average user, it doesn't matter what language you use, they're all just magical gibberish.

I read a few guides on unix shell programming an within a day or two I was able to write useful shell scripts with the "no sense" sed/awk/xargs/... tools.

Bash, combined with a good terminal emulator, is a joy to use. To execute the previous command I just hit 'up' and 'enter'. Can't do that in DOS - 4 out of 5 times it gives you the wrong command. I just can't figure out how command history in DOS works, nor do I care about how it actually works - it doesn't work well and that's all that matters. Does PowerShell fix that?
Tab completion in bash is easy to use. I hit tab and it completes the filename, or completes it as much as possible and presents you with possible choices. In DOS, it completes to the first match and doesn't show you all possible matches, which is stupid. I have to press Tab several times to get the filename I want. Does PowerShell fix that?
In a proper Unix terminal emulator, I can have multiple terminals in one window, seperated by tabs. I can easily navigate between the terminals with Ctrl-PageUp/PageDown, and they don't clutter the task bar. Furthermore, most X window managers can snap a window to the edge of another window or the edge of the screen, making it extremely easy to organize your terminal windows. DOS can't do any of that. Does PowerShell fix that?

People are all talking about how awesome PowerShell is because it uses .NET objects and what not, but frankly it doesn't seem very usable as an *interactive user program*. People talk about PowerShell being a "shell" but it looks more like a scripting language to me. If I want to do more complex things that I can't do easily in bash I'll launch Perl.

Reply Score: 5

RE[5]: Once upon a time
by rcsteiner on Thu 25th Jan 2007 16:40 UTC in reply to "RE[4]: Once upon a time"
rcsteiner Member since:
2005-07-12

Bash, combined with a good terminal emulator, is a joy to use. To execute the previous command I just hit 'up' and 'enter'. Can't do that in DOS - 4 out of 5 times it gives you the wrong command.

That's why many experienced DOS users use 4DOS, why many experienced OS/2 CLI users use 4OS2, and why many experienced Windows CLI users use either 4DOS, 4NT, or both.

The vanilla shell sucks on those platforms, but replacing it is trivial.

Edited 2007-01-25 16:41

Reply Score: 2

RE[4]: Once upon a time
by beowuff on Thu 25th Jan 2007 21:42 UTC in reply to "RE[3]: Once upon a time"
beowuff Member since:
2006-07-26

can you really say any of this makes sense in any language known to man?

Bash is a programing language known to man. Therefore, the answer to your question is, simply, yes.

Reply Score: 1

RE[2]: Once upon a time
by backdoc on Thu 25th Jan 2007 03:22 UTC in reply to "RE: Once upon a time"
backdoc Member since:
2006-01-14

why in the world would someone want to learn bash, one of the most unintuitive shells ever created.

Hmmm. I may be wrong, but I'm drawing the conclusion from statement that you tried to learn it, found it difficult and gave up. Now, you don't think anyone should spend the time learning it.

Now, assuming that I'm wrong and have misinterpreted your comment, when you say most unintuitive shells, I'm assuming you've tried others and found them more intuitive. What shells would those be?

Reply Score: 5

RE[3]: Once upon a time
by ari-free on Thu 25th Jan 2007 05:10 UTC in reply to "RE[2]: Once upon a time"
ari-free Member since:
2007-01-22

ok I'll give an example of unintuitiveness.
let's say you want to delete all files with extension .txt and you type this
rm * .txt

oops forgot I added a space
oops thanks for not telling me I will wipe out all the files and just do it anyway.
Powershell requires confirmation

Edited 2007-01-25 05:12

Reply Score: 2

RE[4]: Once upon a time
by abraxas on Thu 25th Jan 2007 05:14 UTC in reply to "RE[3]: Once upon a time"
abraxas Member since:
2005-07-07

ok I'll give an example
let's say you want to delete all files with extension .txt and you type this
rm * .txt

oops forgot I added a space
oops thanks for not telling me I will wipe out all the files and just do it anyway.
Powershell requires confirmation


If you're that careless then turn interactive mode on. Problem solved.

Reply Score: 5

RE[4]: Once upon a time
by flav2000 on Thu 25th Jan 2007 05:24 UTC in reply to "RE[3]: Once upon a time"
flav2000 Member since:
2006-02-08

ok I'll give an example of unintuitiveness.
let's say you want to delete all files with extension .txt and you type this
rm * .txt

oops forgot I added a space
oops thanks for not telling me I will wipe out all the files and just do it anyway.
Powershell requires confirmation


well... just add
alias rm 'rm -i'
to your .login file or .cshrc (depending on your shell)

problem solved - confirmation for every deletion

Reply Score: 4

RE[5]: Once upon a time
by twenex on Thu 25th Jan 2007 09:22 UTC in reply to "RE[4]: Once upon a time"
twenex Member since:
2006-04-21

I think it's a REALLY BAD idea to alias rm to "rm -i". Not because I'm implacably opposed to interactive deletion (i'm not) but because (a) it might screw up scripts which rely on rm NOT being interactive to work properly; and (b) what happens when you move to the machine of someone who has NOT aliased rm to "rm -i"?

Far better to alias "rmi"to "rm -i" "mvi"to "mv -i" etc, and use those instead. Then when you use a system that uses the default behaviour for "rm" and doesn't have those aliases, it'll say "rmi... not found."

Reply Score: 5

RE[6]: Once upon a time
by John Nilsson on Thu 25th Jan 2007 12:14 UTC in reply to "RE[5]: Once upon a time"
John Nilsson Member since:
2005-07-06

(a) it might screw up scripts which rely on rm NOT being interactive to work properly

Or you fix those broken scripts...

Reply Score: 2

RE[7]: Once upon a time
by twenex on Thu 25th Jan 2007 13:13 UTC in reply to "RE[6]: Once upon a time"
twenex Member since:
2006-04-21

What about people who don't know how to write scripts and are only using the scripts provided by the distro?

Reply Score: 2

RE[6]: Once upon a time
by Ookaze on Thu 25th Jan 2007 16:32 UTC in reply to "RE[5]: Once upon a time"
Ookaze Member since:
2005-11-14

I think you and the people that don't understand a thing about shells (all those that modded you up basically) should STFU and go right away learn to use a shell, and stop pretending you do.
Because your stupid rant about "rm -i' alias that can have impact on a script is just plain BS.
An alias on "rm -i" will just not impact any of your scripts, unless you explicitely make them login scripts, which is plain stupid if it's not your session script.
You're basically complete newbies on shells, which surely explains all the stupid comments about monad being anything good for administration.
FYI, your mistake here is typically how people manage to render their system unusable with a "rm -r *", because they think that having defined rm as "rm -i" somewhere, and it works in their interactive shell, means it will work in their script, and prevent any mistake.

And I hope you actually never went to other people machines to "fix" them, because with your poor knwoledge of shells, you'll just break everything.
Asking what happens when you go to a machine that has not aliased rm to "rm -i" is even more scary. "unalias rm" followed by "alias rm='rm -i'" is sth you should at least understand to help others. Even worse, a simple "rm" instead of "rm" will just bypass any alias you put on "rm", and it works for every command.

You're just an example of people that, instead of asking why everyone does sth this way, just assumes you're better than them all, thinks they're all wrong and you're right, and go implement a really poorer solution. And the monad just seems like that to me, too, a unix shell with all the mistakes embedded.

Reply Score: 2

RE[7]: Once upon a time
by twenex on Thu 25th Jan 2007 18:33 UTC in reply to "RE[6]: Once upon a time"
twenex Member since:
2006-04-21

Well, thanks for that insulting and generally incomprehensible (because of a 3-year old's understanding of punctuation) rant. Remind me to mod you down someday.

Reply Score: 2

RE[4]: Once upon a time
by dcwrwrfhndz on Thu 25th Jan 2007 06:30 UTC in reply to "RE[3]: Once upon a time"
dcwrwrfhndz Member since:
2006-05-26

(sh/bash)
alias rm='rm -i'

(csh/tcsh)
alias rm rm -i

Reply Score: 2

RE[4]: Once upon a time
by Clinton on Fri 26th Jan 2007 04:35 UTC in reply to "RE[3]: Once upon a time"
Clinton Member since:
2005-07-05

Bash is not unintuitive. It is powerful and demands that you respect that power. For example, you could easily implement a "Trash" mechanism in Bash so if you did type that command, your files would be easily retrievable.

I HATE the idea of a shell asking me if I'm sure every time I type a command.

Reply Score: 1

RE[4]: Once upon a time
by DElyMyth on Fri 26th Jan 2007 08:36 UTC in reply to "RE[3]: Once upon a time"
DElyMyth Member since:
2007-01-26

I did something similar some time ago, but it was a chown -R in the /etc directory...
It was solely my fault and I'm only blaming myself because I didn't double-check what I was typing and where.

And, btw, with confirmations for every single deletion, sooner or later you'll switch to the "hit enter without reading" side, and the advantages of the confirmations are gone.

Reply Score: 1

Its the only reason to upgrade
by chemical_scum on Thu 25th Jan 2007 01:16 UTC
chemical_scum
Member since:
2005-11-02

Its the only reason to upgrade from XP

Reply Score: 2

RE: Its the only reason to upgrade
by orestes on Thu 25th Jan 2007 01:51 UTC in reply to "Its the only reason to upgrade"
orestes Member since:
2005-07-06

Why? Powershell runs fine on XP, and has for quite some time.

Reply Score: 5

RE: Its the only reason to upgrade
by MollyC on Thu 25th Jan 2007 04:32 UTC in reply to "Its the only reason to upgrade"
MollyC Member since:
2006-07-04

Its the only reason to upgrade from XP

Not really. PowerShell 1.0 was RTM'ed for XP a couple months ago. I've had it installed since then. It's available here:
http://www.microsoft.com/windowsserver2003/technologies/management/...

The Vista version is also available at the same location, but it's still at RC2 (RTM is "expected" for Jan 31.)

Reply Score: 5

Complicated
by elzurawka on Thu 25th Jan 2007 01:39 UTC
elzurawka
Member since:
2005-07-08

DOes anyone else see this as a bit complicated for a shell?

Reply Score: 3

RE: Complicated
by Cass on Thu 25th Jan 2007 01:50 UTC in reply to "Complicated"
Cass Member since:
2006-03-17

Yeah, it reads to be very complicated, i found myself thinking why not just use cygwin whilst reading the article. To be honest i lost interest when

"When you pipe the output of this cmdlet, called Get-ChildItem, to the cmdlet Sort-Object,"

was mentioned, MS should just cut to the chase and impliment a proper unix (like?) shell without all the seemingly BS layers like what was written. Who needs the shell to work magic for us when the tried and tested

ls -lrt

can do what we need, without all the leg bone connects to the knee bone crud ...

man ls and man sort are your friends .... ohh sorry i assume not with this tool, for this its probably, start --> help --> search for text --> "powershell sort by file size"

Reply Score: 5

RE[2]: Complicated
by backdoc on Thu 25th Jan 2007 03:39 UTC in reply to "RE: Complicated"
backdoc Member since:
2006-01-14

I tend to agree with you. To me, the basic DOS syntax gets me by. Don't get me wrong, I like Unix shells like bash and csh much better. But, I don't get annoyed as much having to type copy instead of cp or dir instead of ls. I can live with that. But, if I want or need some elaborate OO code, I can use Python or C# or something made for writing powerful applications. What I miss are things associated with basic conveniences like:

o hitting tab twice to show more suggestions
o tabs on the command window itself
o up arrow history that can filter based on the few characters you type
o history that #1, works and #2 isn't forgotten between sessions
o includes apps like grep, sort, uniq, cut, sed and awk by default

I should elaborate to say that if MS will just make things less annoying, I will be happy. We have Vista at work. In fact, we have every new MS app at work. And, I have absolutely no interest in installing them. I could, but I'm just not excited by all of the hype.

Edited 2007-01-25 03:42

Reply Score: 3

RE[2]: Complicated
by MollyC on Thu 25th Jan 2007 04:43 UTC in reply to "RE: Complicated"
MollyC Member since:
2006-07-04

PowerShell has aliases for lots of unix commands like ls.

Reply Score: 2

RE[3]: Complicated
by backdoc on Thu 25th Jan 2007 12:31 UTC in reply to "RE[2]: Complicated"
backdoc Member since:
2006-01-14

That's cool. Someone else here mentioned that it accepts forward or backward slashes, too. For me, that will be great. I hate having to type backward slashes on MS. For people starting out, they may get very confused as to which way is the right way. But, you can't blame MS for not switching cold turkey. That would break a lot of things. These are things that I look forward to discovering.

Reply Score: 1

RE[2]: Complicated
by axilmar on Thu 25th Jan 2007 14:17 UTC in reply to "RE: Complicated"
axilmar Member since:
2006-03-20

The purpose of the PowerShell is to allow difficult tasks to be easily coded as scripts. It gives access to .NET, and therefore it can be used for programming scripts, .NET applications, and all kinds of difficult to perform tasks.

Reply Score: 1

RE[3]: Complicated
by nutshell42 on Thu 25th Jan 2007 15:10 UTC in reply to "RE[2]: Complicated"
nutshell42 Member since:
2006-01-12

Then they should have called it PowerScript or MS Visual ADVANCED or something.

But they called it PowerShell and it's quite shitty at that job. For 40MB of memory out of the box you get a shell that's overly complicated and less suited for many shell tasks than bash (or even cmd.exe).

It's great that MS finally made its own Perl/Python/Ruby clone to satisfy their NIH syndrome but in the meanwhile we're still waiting for a powerful shell for Windows without all the jumping-through-loops involved in using cygwin.

Edited 2007-01-25 15:10

Reply Score: 4

RE[4]: Complicated
by twenex on Thu 25th Jan 2007 18:37 UTC in reply to "RE[3]: Complicated"
twenex Member since:
2006-04-21

Right on.

Reply Score: 2

RE: Complicated
by lopisaur on Thu 25th Jan 2007 08:26 UTC in reply to "Complicated"
lopisaur Member since:
2006-02-27

I used to be a Beta tester for this thing, and let me tell you, it's over-complicated. You need to relearn everything you used to know about shells, and I seriously doubt it's worth the effort. I'll stick to my tcsh.

Reply Score: 3

Does it come with all the tools?
by bralkein on Thu 25th Jan 2007 01:53 UTC
bralkein
Member since:
2006-12-20

Now this idea of an object-oriented shell sounds pretty interesting, but is it going to be useful as the Linux/BSD/whatever command line? Basically, there is a huge console-culture on UNIX and UNIX-alikes, so a vast repertoire of tools is available. Even if you don't know what kind of tool to use for the job you want to accomplish, when you're familiar with your system there's always some kind of paper trail (searching package manager descriptions of software suites, flicking through man pages, etc.) that you can follow to find out what you need to do.

A lot of the usefulness of the shell as I use it on Linux seems to stem from modularity. There really seems to be only a very small amount of built-in functionality, and everything else is added on in nice, self-contained modules. As I understand it, this PowerShell gets a lot of its capability from the .NET libraries, which looks like a fairly monolithic approach to be taking. Will it be as useful with 3rd-party contributions?

I'm not bashing PowerShell (no pun intended), since it seems like it's something new, and that's always something to be admired. Also, it's obviously a very young project, so it would be stupid to write it off already. I'm just curious as to how well it's going to work. I mean, bash certainly has its weaknesses, but it also has a well-defined place; for the more complicated jobs where a more flexible, possibly object-oriented approach would be favoured, there's always Ruby or Perl or whatever, right? ;-)

Reply Score: 5

RE: Does it come with all the tools?
by japh on Thu 25th Jan 2007 09:15 UTC in reply to "Does it come with all the tools?"
japh Member since:
2005-11-11

"...but is it going to be useful as the Linux/BSD/whatever command line?"

I think it might be, but just as bash would be pretty useless without all the unix commands like find/grep/awk/..., PowerShell will be useless unless it has the same thing (only I think they're called commandlets in that world).

You need the primitives for listing processes, listing files, printing.
But also, you'll need to be able to interact with other, non-microsoft programs. You will probably also need to parse plain old text in a way that isn't totally awkward.

The thing I see as the best thing with PS is readability.
If I can sort by a named attribute instead of a column number, that's a win. If that attribute knows how it should be sorted then that's another win.
If you look at the man page for 'sort' in your favourite unix you see that you can specify sorting to be alphabetically, numerically, by date and other things.
I don't know all the options, and if I could sort without having to know them, I'd be happier.

Reply Score: 1

Examples?
by DigitalAxis on Thu 25th Jan 2007 01:55 UTC
DigitalAxis
Member since:
2005-08-28

GNU ls -S sorts files by size. You don't even need a sort command.

And if they prefer, ls -s will print out sizes, so you can pass it to the other side of the pipe... just like (apparently) powershell with its size object.

Reply Score: 5

RE: Examples?
by backdoc on Thu 25th Jan 2007 04:01 UTC in reply to "Examples?"
backdoc Member since:
2006-01-14

But, sometimes you want to sort the contents of a logfile or something.

For example,
cat error.log | sort -n +4

Reply Score: 1

GNU Version of Monad?
by SpasmaticSeacow on Thu 25th Jan 2007 02:04 UTC
SpasmaticSeacow
Member since:
2006-02-17

I understand that the Mono team will provide a GPL'd equivalent to Monad called "Gonad". Time to send Miguel and the boys a case of Bawls.

Reply Score: 5

In concept it is better than UNIX shells
by codehead78 on Thu 25th Jan 2007 02:13 UTC
codehead78
Member since:
2006-08-04

UNIX shells require you to parse text output to get at the data you want. Passing objects around just makes more sense.

As a CLI it's not bad either. It will take / or as a path separator.

Reply Score: 5

FishB8 Member since:
2006-01-16

Passing objects around just makes more sense.

I'm not so sure that's such a great idea. Sure, it makes it a bit less of a mess, but what do you do when you're trying to pipe to/from a 3rd party program that doesn't support this object model?

Reply Score: 4

codehead78 Member since:
2006-08-04

I'm not so sure that's such a great idea. Sure, it makes it a bit less of a mess, but what do you do when you're trying to pipe to/from a 3rd party program that doesn't support this object model?

Serialize the object to text. It's easy to go from an object to text, but not the other way.

There is a reason we have the notion of structures in programming languages and don't store everything in strings.

Reply Score: 3

rajj Member since:
2005-07-06

You can represent any in memory data structure as a text stream using some form of markup. XML comes to mind for the more complicated cases. Simple white space works for the more trivial cases.

Reply Score: 3

shotsman Member since:
2005-07-22

The last thing that we need is to use XML for passing data between apps in the command line.
Two Reasons.
1) XML in these cases would be self defining (no XSD) thus parsing it in the target application would be a nightmare, unless you want to have a "Generaic ALL Apps XSD"
Which leads me to the second
2) Look at the mess MS in got itself into with Office XML. The spec is 6000+ pages! This sort of bloatware is something we dont need. Then there is the danger of MS making it Namespace enabled and somehow forcing it to go out over the net and do an underhand WGA Check?
Ok, I might be speculating a lot but this is the sort of thing that MS might get up to if they enabled XML as the object passing mechanism in a shell.

Please remember the KISS principal.
XML is not the solution here.

Reply Score: 5

rajj Member since:
2005-07-06

I didn't say it was a good idea, just that it can be done. I also mentioned white space (line newlines) ;-).

Reply Score: 1

acamfield Member since:
2006-11-17

And what happens when windoze in their infinite wisdom changes an object class but doesn't teach the other cmdlets how to deal with the new properties. Piping works because it's simple and every Unix/Linux CLI program understands it. This is a typical MS answer for a problem that doesn't exit.

Reply Score: 2

Tyr. Member since:
2005-07-06

UNIX shells require you to parse text output to get at the data you want. Passing objects around just makes more sense.

No need for objects, just make commands optionaly accept xml in/output. That way you would have the benefit of both structured output and text based output in both xml and human-output modes. There was actually a project that developed xml-based replacements for common unix commands, but I can no longer find it.

The MS solution seems too over-engineered and buzzword compliant (aah objects) to me.

Reply Score: 4

japh Member since:
2005-11-11

I'm thinking that "over-engineered" and "buzzword compliant" might also apply to a solution that use xml. ;)

Reply Score: 1

backdoc Member since:
2006-01-14

Hmmm. Now, I'm sure passing objects around will come in handy one day. But, generally, I think of a shell as an "interface" not a "scripting language". So, I'm just more interested in the forward slash backward slash thing than the scripting part. If I need something more powerful than simple bash or dos scripts can handle, I'm thinking about using Python.

Reply Score: 1

oh noes. it's woosh
by Cloudy on Thu 25th Jan 2007 02:54 UTC
Cloudy
Member since:
2006-02-15

the Windows Object Oriented Shell!

(or the sound made by the concept of shells passing over the head of MS)

I wonder how long it'll be before anyone gets that both the GUI and the CLI have a place in using systems and implements a good unified UI.

Reply Score: 5

RE: oh noes. it's woosh
by dylansmrjones on Thu 25th Jan 2007 18:53 UTC in reply to "oh noes. it's woosh"
dylansmrjones Member since:
2005-10-02

Haha ;)

Sorry I can't mod you up, but heehee ;)

Reply Score: 2

Very nice idea...
by tux68 on Thu 25th Jan 2007 08:44 UTC
tux68
Member since:
2006-10-24

Well I almost didn't even bother to read this article, but am thankful I did. This actually does sound like a very elegant idea. It seems like a natural evolution to go from everything-is-text to everything-is-an-object. Of course there will still be places where pure text processing is appropriate, but there is no reason such operations can't be fit into this design.

It has the potential to make scripts more robust, where pipelines aren't dependent on the order of fields in their input. And things like full tab completion fall out of the design for free.

What I wonder is if the objects that get passed around are mutable? If so, the third command in a pipeline could alter a passed in object (that had been sorted and passed through a selection filter) to update a database, or icon, or endless other possibilities. That would be quite a powerful ability and an advancement over what is offered in any *nix shell today.

Reply Score: 5

Huh?
by twenex on Thu 25th Jan 2007 11:39 UTC
twenex
Member since:
2006-04-21

How can something that never went away make a comeback?

Reply Score: 2

It looks like a pain to me
by Priest on Thu 25th Jan 2007 12:29 UTC
Priest
Member since:
2006-05-12

Sure they whole passing oblects not text thing is a cool theory, but what does the syntax for the language actually look like?

from http://en.wikipedia.org/wiki/Powershell
Calculate the number of bytes in the files in a directory.

In powershell:
get-childitem | measure-object -property length -sum

In bash:
du -h

And it is not like the bash command is cryptic, du = "disk usage", the -h is not even required but it is the flag for "human readable", so you don't get an answer back in KB.

For some more interesting info check out the Powershell sctipts on Technet here: http://www.microsoft.com/technet/scriptcenter/scripts/msh/default.m...

The following script is designed to "List IP4 Route Table Information" (like route -p or netstat -r)

$strComputer = "."

$colItems = get-wmiobject -class "Win32_IP4RouteTable" -namespace "rootCIMV2" `
-computername $strComputer

foreach ($objItem in $colItems) {
write-host "Age: " $objItem.Age
write-host "Caption: " $objItem.Caption
write-host "Description: " $objItem.Description
write-host "Destination: " $objItem.Destination
write-host "Information: " $objItem.Information
write-host "Installation Date: " $objItem.InstallDate
write-host "Interface Index: " $objItem.InterfaceIndex
write-host "Mask: " $objItem.Mask
write-host "Metric 1: " $objItem.Metric1
write-host "Metric 2: " $objItem.Metric2
write-host "Metric 3: " $objItem.Metric3
write-host "Metric 4: " $objItem.Metric4
write-host "Metric 5: " $objItem.Metric5
write-host "Name: " $objItem.Name
write-host "Next Hop: " $objItem.NextHop
write-host "Protocol: " $objItem.Protocol
write-host "Status: " $objItem.Status
write-host "Type: " $objItem.Type
write-host
}


WOW, they reall made _that_ easier.

Reply Score: 5

RE: It looks like a pain to me
by smashIt on Thu 25th Jan 2007 13:05 UTC in reply to "It looks like a pain to me"
smashIt Member since:
2005-07-06

In bash:
du -h

And it is not like the bash command is cryptic, du = "disk usage", the -h is not even required but it is the flag for "human readable", so you don't get an answer back in KB.


but diskusage and filesize are 2 different things

Reply Score: 1

RE: It looks like a pain to me
by load_mic on Thu 25th Jan 2007 13:53 UTC in reply to "It looks like a pain to me"
load_mic Member since:
2005-12-13

This reminds me of Windows Script Host. Why write two lines of Perl when you can write 12 lines of VBScript?

PowerShell seems to be more of a vehicle for .NET adoption than a solution for sys admins.

Reply Score: 4

Names are all wrong
by troc on Thu 25th Jan 2007 12:43 UTC
troc
Member since:
2006-05-01

The 'Tech Analysis' and 'PowerShell' are neither of what they portend to be.

The tech analysis is no more than an impression. There is no systematic deconstruction, comparison or expression of objective aims in this article.

Like wise the name chosen for monad is boastful and disingenious. What wrong with a normal name such msh ? If as a company you can't name your products with out the unecessary hype (office/vista); how can we trust it is designed, produced or supported in a sane way.

I suppose it can all be summed up by a peek at dsa.msc and the Exchange System Manager.msc ;) This is more than vindication for the *nix like cli, as PowerShell is probably doomed to cp it poorly. To end on a constructive note, what MS should have done is absorbed cygwin and exposed all its internals (csvde, cacls, services and registry) via *text only*. Then ensured that these methods were available remotely, by default, like it is so easily,securely and conviniently done through ssh on *nix today. None of this 1/2 arsed psexec/dameware/gp based admin insanity we have now.

Reply Score: 1

RE: POWERS@$t
by Bryan on Thu 25th Jan 2007 22:30 UTC in reply to "POWERS@$t"
Bryan Member since:
2005-07-11

I'd say nice try, but it isn't even that:

http://blogs.msdn.com/powershell/archive/2006/08/03/687838.aspx

Reply Score: 1

Not to be the pessimist
by TechGeek on Thu 25th Jan 2007 15:31 UTC
TechGeek
Member since:
2006-01-14

But, how long until people start writing viruses and worms using this technology? We all know that MS security is lax, but now a powerful new scripting tool has been added to the mix.

Reply Score: 1

Then, Windows came along? WTF? Um, Mac?
by walterbyrd on Thu 25th Jan 2007 16:08 UTC
walterbyrd
Member since:
2005-12-31

Talk about revisionist history. Apple had a hugely popular GUI based OS more than a decade before Windows-95. And many would argue that Win95, was just a buggy shell for DOS.

Msft didn't have a half-way worthwhile GUI based OS until 2000 - sixteen years after the Mac.

BTW: I don't use Mac, never have. I am no Apple fanboy, but this sort of revisionist history is too much.

Reply Score: 1

twenex Member since:
2006-04-21

Don't forget that Amigas had a "half-way worthwhile GUI based OS" in 1985 - and unlike the Mac it had colour! Also unlike the Mac, it had a pretty worthwhile command line interface - different from Unix, and probably inferior to it, but definitely superior to MS-DOS.

Reply Score: 3

/bin/rm
by J-freebsd_98 on Thu 25th Jan 2007 17:43 UTC
J-freebsd_98
Member since:
2006-01-01

well, I only use (so far)
#dir## /bin/rm -iv
#dir## /bin/rm -rf
(being really really careful sometimes with a
ls beforehand, once deleting /tmp rather than
./tmp )
#dir## /bin/rm -v
(being really REALLY careful with always a ls beforehand)

Reply Score: 1

Shall we play a game?
by MollyC on Thu 25th Jan 2007 18:17 UTC
MollyC
Member since:
2006-07-04

Here's a pretty cool Powershell script that I saw at digg:

$v = new-object -com "SAPI.spvoice"
$v.Speak("Shall we Play a Game?")

I know it can be done on with other systems, but I didn't know this could be done with PowerShell until I read about this at digg, and I thought it was cool. :-)

More importantly, it shows PowerShell's ability to work with COM objects (besides .NET objects), via .NET's COM interop.

So one could mix and match COM and .NET objects in a script. And one can drive any app that implements OLE Automation.
For example one would instantiate an Excel COM object with:
$o = new-object -com "Excel.Application"

(With VSTO, I think PowerShell might be able to talk with Excel via .NET without using .NET's COM-interop functionality, but I'm not sure.)

(BTW, VBScriptHost already allowed for driving of automation apps, as do various so-called "scripting languages" like Python, and AppleScript drives apps on Mac OSX (and Cocoa apps automatically get some default scriptability), so no, I'm not claiming a "breakthrough" here, just adding to the discussion.)

Reply Score: 2