News for hackers. Stuff that matters.
Re:PowerShell vs. Unix shells by dingle_thunk on Friday July 13, 2012 @09:21AM (#4239668)
> PowerShell is still treated as a second class citizen in the Windows eco-system

This is so completely wrong it's not funny. The majority of Microsoft's server GUIs are now built completely on PowerShell. This includes basic products like IIS, Exchange, etc. Where I work, most consultants who implement or maintain these products have learned PowerShell and use it regularly. Windows Server 2012's default option is "headless" install (Powershell only), and that's been an option since at least Server 08 R2. Powershell is certainly not an afterthought - it is at the core of Microsoft's server administration GUI plans. MS have completely committed to it.

Re:PowerShell vs. Unix shells by tammer on Friday July 13, 2012 @10:22AM (#4239909)
Interesting - babarock is incredibly wrong from the windows perspective, but from the unix perspective entirely correct. (I work in IT and handle things on both sides.)

Comparatively, the recent and steadily increasing reliance on PS is evidence of microsoft's recognition of the utility of a shell for managing their more complex software.

On the other hand, the fact that PS doesn't have it's own readline yet (it's just a wrapper for the cripplingly ancient CMD) and its incredible lack of basic features (just try managing AD users in PowerShell - sure its easy once you've written your own custom script or mapped it to a web interface or something, but there's no built in equivalent for adduser or about a billion other basic UNIX commands).

It all depends on your perspective. I'm glad to see MS moving away from their decade of GUI dependence.

Re:PowerShell vs. Unix shells by hartez on Friday July 13, 2012 @01:56PM (#4240924)
just try managing AD users in PowerShell - sure its easy once you've written your own custom script or mapped it to a web interface or something, but there's no built in equivalent for adduser or about a billion other basic UNIX commands

It's not that bad. Adding a new AD user is a built-in command. From the docs:

New-ADUser GlenJohn -OtherAttributes @{title="director";mail="[email protected]"}

I'm not a UNIX admin; maybe the adduser command is easier. But managing AD stuff in PS is pretty easy (especially if you have to do it in bulk).

Re:PowerShell vs. Unix shells by niels_olson on Friday July 13, 2012 @06:28PM (#4242335)
me@my_server$ useradd -G director glenjohn

glenjohn@my_server$ vi .forward

:a

[email protected]

:wq

And there are at least a few other ways to do that. But you certainly don't have to be an admin to specify an alternate email address.

Re:PowerShell vs. Unix shells by jules on Friday July 13, 2012 @03:12PM (#4241353)
Have you used PowerShell ISE 3.0? Its user experience is better than the standard tools on *nix that I've used, and of course much better than the old powershell. You get very good autocompletion (similar to what you get in IDEs like Eclipse or Visual Studio), syntax highlighting, debugger, etc.
Re:PowerShell vs. Unix shells by davidacoder on Friday July 13, 2012 @03:33PM (#4241458)
But you can't use things like git from ISE because it doesn't support interactive console apps...
Re:PowerShell vs. Unix shells by rome on Friday July 13, 2012 @01:31PM (#4240792)
Powershell isn't a wrapper for CMD. It's a separate interface for WMI, COM and .NET.
Re:PowerShell vs. Unix shells by zem on Friday July 13, 2012 @02:05PM (#4240988)
he's not talking about the powershell engine, he's talking about the frontend repl you interact with
Re:PowerShell vs. Unix shells by jcurbo on Friday July 13, 2012 @01:39PM (#4240832)
As I understand it, a lot of Microsoft's certification training materials and tests are Powershell oriented... instead of clicking around in GUIs they teach you how to make the changes via Powershell commands. (I'm not an MS admin but I've heard this second hand so my apologies if it's not completely accurate)
Re:PowerShell vs. Unix shells by UnFleshedOne on Friday July 13, 2012 @11:58AM (#4240338)
One big problem with powershell is that it is not installed on all windows machines by default (I think it is only on some server versions). So you can't just whip up a script and have it run on any machine like you can with bash, which is a first class citizen.
Re:PowerShell vs. Unix shells by tonyedgecombe on Friday July 13, 2012 @12:33PM (#4240483)
I think it comes as standard on Windows 7, I'd be very surprised if it isn't in Windows 8.
Re:PowerShell vs. Unix shells by jff on Friday July 13, 2012 @12:15PM (#4240399)
Please, "like you can with the Bourne shell". Scripts that assume you have bash make baby Jesus cry.
Re:PowerShell vs. Unix shells by ajross on Friday July 13, 2012 @02:16PM (#4241059)
Only if baby Jesus is using an open source BSD. Bash is standard on all Linux and OS X installs, and vastly more featureful than the POSIX sh standard. If you're a decent bash hacker and really in a situation where you can't rely on a better scripting runtime to be installed, you'd have to think really hard about whether FreeBSD/OpenBSD is worth the hassle.

Honestly, the BSDs need to get their act together on this and either bash-ify their shells or just use it. Their existing environment is pretty poor.

(I guess an argument could be made that Android is another non-bash environment. But the shell there is so terrible that I literally don't know anyone that's used it for anything in production.)

(Edit: I guess technically I should include Solaris people in the list of bashless victims. But, well, yeah...)

Re:PowerShell vs. Unix shells by rat87 on Friday July 13, 2012 @04:05PM (#4241607)
Possibly they could make zsh the default interactive shell, bash is GPL. If you need a better scripting runtime python is probably a better bet.
Re:PowerShell vs. Unix shells by ajross on Friday July 13, 2012 @04:12PM (#4241628)
It depends on what you're scripting, some things really are expressed best in the shell.

But tools like perl, python and ruby aren't nearly as universal as you'd like them to be. Obviously if you maintain the box and are deploying an app, they're trivially available. But if you're shipping software to be installed on end user boxes of unknown configuration, they're a dependency that can bite you. That's why things like self-extracting archives and shell-based initscripts persist, even though they look ugly to modern eyes. They do what they need to do very well, and they do it universally.

Re:PowerShell vs. Unix shells by mhurron on Friday July 13, 2012 @12:50PM (#4240564)
Depends on your target. Bash is the LSB shell. If your scripts are only targeting Linux, then you should be able to safely assume bash is there. On Linux, by default, there isn't even a real Bourne shell anyway; it's a symlink to bash.

If you're writing cross-platform then yes, sh would be a better target, but a lot of environments are going to be Linux only.

Re:PowerShell vs. Unix shells by georgemcbay on Friday July 13, 2012 @02:31PM (#4241147)
"On Linux, by default, there isn't even a real Bourne shell anyway; it's a symlink to bash."

For a lot of Linux users (Debian/Ubuntu) /bin/sh is a symlink to dash.

Re:PowerShell vs. Unix shells by eru on Friday July 13, 2012 @10:54PM (#4242945)
Doesn't Ubuntu use dash by now?
Re:PowerShell vs. Unix shells by UnFleshedOne on Friday July 13, 2012 @12:25PM (#4240447)
Fair enough. Still, I haven't seen a desktop linux that didn't have bash in a while.
Re:PowerShell vs. Unix shells by yen223 on Friday July 13, 2012 @09:29PM (#4242769)
I personally wished Powershell came preinstalled with Windows. Windows' native terminal is really horrible (try running a FOR loop!).