Microsoft PowerShell RC1
rst+ack writes "Microsoft has released RC1 version of PowerShell the .NET-based shell with perl-like syntax previously known as Monad or MSH. PowerShell (PS) has been covered a few times on Slashdot. Contrary to cmd.exe and Unix/Linux shells it operates on objects, not text when passing data between scripts and executables. Easy access to .NET classes allows users to create quite advanced solutions in short time. PS won't be shipped with Vista or Windows Server 2007 but it will debut with Exchange 12."
Can you resize the window and copy and paste easily into the windows. If so it's already 10 times better then CMD.EXE.
evil is as evil does
Why would you want to use an arbitrary, difficult to debug format like text when you could use
-Peter
Ahem:
Those who do not understand Unix are condemned to reinvent it, poorly.
If so, sign me and Fred Savage up!
"Made up/misattributed quote that makes me look smart. I am on
I don't know, it sounds a lot more like the REXX and AppleScript way of doing things to me. An application exposes a dictionary of possible actions (rephrased in OO, an application object exposes methods) and passes the results to the next REXX or AppleScript-aware application.
Both REXX and AppleScript predate wide scale adoption of OO, so I might be off-base. It does sound very similar though, and personally I think there's room for both that approach and the classic Bourne shell-style approach.
Cheers,
Ian
Is it just me or does it seem insanely odd that a "shell" for an OS is a) shipped seperately and b) doesn't use text as a native data type? Maybe I'm stuck in the "past," but I always saw the shell as the barebones method for a user interact with an OS. Either this really is cutting edge (object data types) or this is just a hyped-up .NET application that is designed to *look like* the shell.
I wonder if the trademark works. They will probably have to call it Power Microsoft Shell. People will likely want to have Unix-like piping of textual results. Does this mean a Text array gets instantiated, or is it a stream object?
It will be a general download to the OS as well. It's just that the admin scripts shipped with Exchange will rely on it.
Guys, next time, think about making it do something before you put out a release candidate.
Windows PowerS hell
I knew it all along!
brightloudnoise.com
What I want to know: does it come with a text version of Clippy?
Nothing interesting to say...MUST...NOT...REPLY...ohtheheckwithit.
Hm, what kind of security do you expect in a shell? But, IIRC, you can run scripts under any .NET permission set, which means that you can emulate stricter permissions than the user you are running under (just like the Java VM does). I think there is also some code signing possible, but it's always a tradeoff, isn't it? It's not exactly like you want to log into some kind of stealth mode to just sign a script you have edited.
So: You want a shell-like environment that lets you type in commands to operate on objects representing files, directories, etc.
Great! Install python*, install the file packages, open the interactive interpreter... you're done.
Why bother waiting for this MONAD thing? It looks like all MONAD offers over any other interactively interpreted programming language right now is that it is compatible with the C# object model. Which, y'know, on the one hand, the UNIX "glue" platforms (python, perl, ruby, kde, gtk) could totally benefit from a unified object model that would allow you to construct an object in a GTK+ application, pass it to a perl script, pipe it to a ruby app, etc. But, y'know, on the other hand, python on windows supports the CLR/C# object model as well... and it's available now.
* Or ruby.
- Oisin
PGP KeyId: 0x08D63965
RTFM mate. This is not reinventing the wheel. It's adding a few more spokes, better tires and tougher rubber.
PGP KeyId: 0x08D63965
The thing in *nix is that most applications support the shell. They are built for piping stuff in any possible way. Are the Windows applications going to be built with the shell in mind or is this going to be yet another cmd.exe where you have to build your own stuff to do what you want instead of like *nix where you just pipe at your hearts content.
I have also a hard time imaging using objects being easier to understand for normal admins and users.
Also, when exactly did the shell stop to suck and begin to be a good feture? The same second Microsoft made their own version?
HTTP/1.1 400
Uh, it is a COMMAND SHELL? Of course it's text input based. They also claim that future graphical admin tools will render the equivalent commands in a text field, somewhat like what you describe. But this one certainly uses a text-based interface... The object-orientation is just about how commands interact with each other, especially when piping. Plain text piping between commands (note, not processes, the builtin commands are objects that will generally live in the same process as the shell itself) is a limited special case of this.
Unix shell scripts are also incredibly good at manipulating text files, using awk, grep, sed, cut, etc. I tried to do such a task with PowerShell and found it wanting. I revered to Windows Services for Unix (basically the Korn shell).
For those who don't know, a monad is a notion in functional programming languages that is a way to structure computations in terms of values and sequences of computations using those values. Monads allow the programmer to build computations using sequential building blocks, which can themselves be sequences of computations. This is not dissimilar to how PowerShell works, but really, I when manipulating text files, I don't want to be dealing with functional programming language abstractions.
No, linux is an implementation of Unix, not a reinvention of it. It's POSIX-compliant. Windows is still fumbling around with basic lessons which were learned by unix professionals years ago. Nothing different than you'd expect from an OS designed for home computers really.
As for monad/powershell... it's the same story. Instead of having the shell of your choice (bash,csh,zsh,python...) with the programming language of your choice (bash,perl,python,C++...) they're still trying to force a vision on people that will probably turn out to be fundamentally flawed in some way.
>They will probably have to call it Power Microsoft Shell.
Power Microsoft Shell - PMS, would this be a description of the shell's behavior?
Doesn't appear to be a way to get a copy to look at unless you have Passport which seems to require a hotmail account. I don't have time to read a couple of dozen licensing agreements atm and it looks like if I register I'm basically signing a non-compete license with Microsoft. Not really a term that I am willing to agree to. Has anyone gone through the contracts?
/* TODO: Spawn child process, interest child in technology, have child write a new sig */
BASH shell-scripting kicks ass. So do PERL, Python, the Korn Shell, PHP and C (and it's derivatives). I know enough about all of them to use one or more of them to do most of the tasks I need to do in the timescale I need to do them.
I've never programmed anything in any Microsoft programming environment because I've never needed to - and it would take me far too long to learn their way of doing things from scratch rather than working with what I know.
However, I know a few MS-based programmers who managed to develop the tools they need to in .NET or whatever it is they use - I'm sorry, I'm not informed enough about MS programming environments to voice any more opinions about it.
Suffice it to say, they're happy and I'm happy.
So everything is right with the world.
End of story.
Gentoo Linux - another day, another USE flag.
First of all, I would have to upgrade from Windows/2000 Professional to Windows/XP Professional. Since this costs money, I'm not terribly interested. My system has enough trouble running all the stuff I run now (2 databases, a web server, an application server, a development environment, etc. etc.). More operating system overhead is the last thing I'm interested in.
Second of all, I get to write scripts in another language that's not portable across all platforms. I've never worked in a monolithic environment, and I probably never will. Cross-platform tools are a requirement.
Third, I can do a lot of administrative programming for Windows in Perl. I imagine python and ruby have similar hooks (haven't checked). For personal productivity I run Cygwin's version of bash on this machine when I'm running Windows, and bash when I'm running Linux. Different people may want different interactive tools. Fortunately there are several cross-platform choices.
Finally, while I've heard about all these productivity gains with C# and .NET, I've not experienced it. I have .NET, C#, and Visual C++ .NET on the Windows side of my environment. What I've seen is that Microsoft makes a credible IDE. The IDE makes simple things easy, and complex things ridiculous. Transferring skills learned in the Microsoft world to any other environment is difficult at best, and pointless for the most part.
Oh - never mind - that's Microsoft's point.
Except the spokes are perpendicular to the old ones, the tires are on the inside and the rubber melts at high speeds.
I encourage you all to come kick the tires and find out what PowerShell really does/does not do. I think you'll be pleasantly surprised by its power and simplicity and might even like it. Many of us on the team have a deep background in UNIX and brought that into our work. Even if you don't like what we've done, trying it out will allow you to know enough to throw your rocks accurately. :-)
a milyId=2B0BBFCD-0797-4083-A817-5E6A054A85C9&displa ylang=en
http://www.microsoft.com/downloads/details.aspx?F
If you'd like to learn more, you can read our team blog at:
http://blogs.msdn.com/PowerShell
Enjoy!
Jeffrey Snover
PowerShell Architect
It's a legitimate question. The security of PSH is mainly two-pronged: first, as in every other console/shell, including cmd.exe, commands and scripts can only act with the permissions that the current user has. This is the standard *nix way of doing things, and it should be far more effective in Vista once proper LUA is finally well-implemented. The other prong is a combination of security features. First, there will be no default associated file type for PSH scripts, meaning that by default, it is not possible to double click a script file and have it run, like you currently can with .BAT files. You can always create an association, but the default behavior is to instatiate the shell first, then run the script with a command-line command. Second, by default, scripts in the current director must be explicitly invoked (equivalent to not having "./" in your PATH). Third, PSH will support code signing, so that scripts must be digitally signed by a trusted publisher. This can, of course, be yourself, because you can easily enough create a cert and trust your own certificate. But it would prevent a lot of trojan attacks.
If you don't know where you are going, you will wind up somewhere else.
I'm an avid Python, PHP, Perl, Ruby, and C# programmer.
.NET you can switch from C# to C++ to J# and still use the same common libraries! And if you already know C, then learning C# is a piece of cake. Same for Java and J#. Your "learning curve" comment is totally unjustified as far as I'm concerned.
Ok, those *nix languages are all fine (I particularly am fond of Python), but C# is definitely a very nice language. Give credit where credit is due.
I can tell you from personal experience that I haven't found development/debugging tools in any of those other languages that compare to Microsoft's.
And as for your comment about the learning curve, I totally don't get that. So you have no problem with the learning curve involved in learning Perl, Python, Korn, PHP, and C and yet you have a problem learning c#? Those languages don't even share the same libraries; at least with
I know its hard to accept microsoft did something good, but as someone who has been using betas of this for months, I must say it is pretty darn slick.
Think of how great your linux environment is, becuase you can easily chain together applications that pass textual data between each other... This is the same idea, except we can now pass complex objects and custom data types as well.
To solve the problem of how to 'display' an object, each object type can have an xml file describing how to display it in a text environment.
Big ones, small ones, some as big as yer 'ead!
Give 'em a twist, a flick o' the wrist...
Hands in my pocket
Windows PowerShell RC1 (for .NET Framework 2.0 RTM) x86
f 14c-8009-43ad-b953-1b18609cf14c/PowerShell_i386.zi p
http://download.microsoft.com/download/e/8/c/e8cc
You might look into Cygwin and rxvt.
Couldn't they have picked a different name? I've been using PowerShell on Linux for years now. It's a terminal emulator for X11 (like xterm) and is the first result on Google for the word PowerShell. Now a terminal emulator isn't exactly the same as a shell, but I could see some confusion occurring as a result.
Can I use ls to get a file listing yet?
Am I the only one here who has spent weeks of work time writing batch and vbscripts to automate operations on Wn2k Servers and networked Windows clients? If this works as advertised (and if I was still running Windows) Id use it.
Its a step in the right direction and anything that extends an admins ability to write effective scripts is a bonus. After all whilst it may have taken me a few days to write some of the more complex scripts that we used it would have taken longer to write an application in VB or C to do the same job.
(BASH is my shell of choice, its because I have an unhealthy obsession with grep...)
nb Not spell checking this post - its too early
Although I haven't played with it, I've read a bit about this shell, and there was something that bothered me about it, and I finally just put my finger on it: this thing was designed by programmers.
.Net libraries are vast and complex... looking at some of the sample msh scripts, I understand how a windows programmer would think they were an amazingly powerful simplification, but damn there's a lot I have to know to get basic things done.
.Net code in my life, I see almost nothing familar when I read .msh scripts. It appears to require an entirely new body of knowledge to do simple things, and bears little or no relationship to the interfaces and paradigms I use day to day. Yes, I know those interfaces are graphical. Seems to me there's bound to be some way to do it (or would be if there were any logic or consistency to the organization of the everyday administative interfaces in Microsoft's products).
I know that the line between "programmer" and "system administrator" is often blurry. And the line between "shell" and "interactive script interpreter" is as well. But when you start requiring people to understand concepts like objects (which may seem like old hat to a programmer), you're already presuming a relatively sophisticated understanding that an "average user" has no grasp of. And the
Ye olde csh and sh are great because they provide a simple way to put programming logic around the set of operations users spend their entire day in and are already familiar with. The learning curve is very incremental: you can master the basic UNIX commands, and then start to add in variable subtitutions (!$ anyone?) and loops (foreach) and such as needed.
In other words, the jump from basic UNIX user knowledge to simple scripting is very small, because the scripting is presented in *exactly* the same context and using the syntax the user does day-to-day work in. But as a competant windows admin who doesn't know VB and hasn't written a line of
Don't get me wrong... I understand that the goal of an intuitive scripting tool is in many ways at odds with providing a rich and powerful development environment that can complete with something like perl, but I had hoped there was something a little closer to "ground level" coming.
-R
Virtually communication under Unix is text-based, no matter it's human-to-program or program-to-program. The CLI output/input is text based; the configuration file is text-based; the log is text-based. I think the reason is that most of the stuff is originally designed for human to read: the thing you pipe to another program is initially intended to be examined by human; the configuration and log is also built to allow a human to read, interpret and change them, manually. However, when this human-oriented (or geek-oriented) text is used to glue different programs, it means extra work to parse them. Thanks to awk and the standardization on standard programs like ps, so far, so good.
We actually have already seen troubles with this approach. How many programs have tried to override your xorg.conf/sources.list/sshd_config because they don't have a nice way to just insert a few records and gracefully remove it later? Wouldn't it be better if the configuration system provides API for other programs and, more importantly, scripts to interact with it and a GUI/CUI/curse for human to change it, just like what gconf2 has done?
Maybe it's time for us to put more OO-friendly stuff into UNIX. Apple/OPENSETP has been along the OO-based API road for like 10 years, and MS is trying essentially the same thing with .NET. It's true that we have a lot of OO goodies on UNIX like python and ruby. But the problem is that they are at a higher level, and therefore if you want a python program to interact with ruby, you have to dump your object into text and parse it back into object representation at the other end. It would be nice if we could have some lower-level object layer or simply standardize an object serialization scheme.
It's true that intercommunication with objects is more efficient and flexible for computer programs.
Why does the entire world have to look like a scripting language from an OS designed four decades ago?
Wheels -- thousands of years old. Still work.
Fire -- hundres of thousands of years under human control -- still works.
And you -- still typing after all these years, over a hundred now, since the invention of the keyboard. Still using fonts, for pete's sake, on graphical displays, invented before UNIX, along with mice, still using silicon (60 years old) and rust (thousands of years old) and electricity, back before Mr Franklin's experiments with kites 250 years ago, still using bits for storage as characters, processed by computer instructions, over 50 years old. Why haven't you graduated to something modern?
Infuriate left and right
Examples 3
Find the total bytes used in the current directory
The example is a 6 line script in ksh, or, a 3 step pipeline using awk to do the following:
du -b .
Hmmm...
Example 5
Find out when a process is no longer running.
The example shell script is 11 lines long, features two tests and two pipelines into variables to do the following:
while
ps -e | grep application ; do
sleep 10
done
echo "not running no more"
These are just two - I can see simple little pieces of shell that are trivial to make work on any modern posix system for all the examples provided, except for the laughable
Example 6
where they (Microsoft's rather amazing ksh coders) say there's no way in Unix to see what version of the code is running. Well yes, it's not the shell's job to keep track of that, but anything written using gnu getopts or written by anyone who actually keeps track of versions uses '-v' or '-V' to display that information.
The so-called examples page I linked to is really a page that is designed to convince Windows-only people that they can now have the power we have been used to for 20+ years. Anyone who actually has written any scripts bigger than "echo 'Hello World!'" would be laughing at their examples of "Unix Shell Scripts".