Live data from Hacker News

Jeffrey Snower was originally demoted over PowerShell

twitter.com

31–40 of 153 posts

Re: Jeffrey Snower was originally demoted over PowerShell

#31

Question for the PowerShell afficionados: Do you consider PowerShell to be "something we can count on to exist on Windows systems, in the absence of Bourne-like shells" - or is it "a superior alternative to Bourne shells which only got traction on Windows because Bourne is too deeply embedded in the Unix world"?

It's a better design, imo.

Have you ever wanted to write a command line executable and gotten hung up on I/o and parameter parsing?

With PowerShell you can write a cmdlet in C# as a PowerShell module and have strongly typed input and output parameters for free. It's a revelation.

As as scripting language, it's fine but for me the killer feature is being able to easily extend it in a non-scripting language.

Re: Jeffrey Snower was originally demoted over PowerShell

#32
post #29

Earlier quoted context omitted.

Powershell runs on Linux and macos too because of .NET Core/5+. The real reason is likely the same sort of people that are still typing Micro$oft in and keep spreading FUD that .NET isn't OS.

I have never heard anyone "spreading FUD that .NET isn't OS" but I have heard plenty of times from Mac and Linux users, "why would you want to use PowerShell" and I am mining this thread for answers, because I honestly don't know for myself. And it's objectively true that .NET/PowerShell is targeting Windows users, (which if you're Microsoft, why wouldn't you do that?) so, assuming that you don't care about interoper…

.NET is still ignored a lot as consequence of FUD. But you are right, there is not much FUD.

The rest is spot on. Powershell has it space when you need manage windows and Linux Server using a shared platform. And that is where Microsoft puts it. As a .NET based management platform for services and operating systems on both, Linux and Windows.

Re: Jeffrey Snower was originally demoted over PowerShell

#33
post #9

Earlier quoted context omitted.

the latter, though I may have some Stockholm syndrome. killer features: * objects are streamed, not text. I look upon sed and awk and their ilk as stone knives and bear skins. why not just dot into fields? * first-class interaction with libraries. I can import managed DLLs and call their methods. I don't have to build weird little one-off tools or expose porcelain. I can get at everything, it's profoundly hackable in…

Cygwin has been a reliable features-complete alternative IMHO

How is Cygwin comparable? That's like saying Wine can be compared to cmd.exe.

Re: Jeffrey Snower was originally demoted over PowerShell

#34
post #23

I've often wondered why powershell hasnt taken off on linux/mac. I'd guess MS would have a good case for investing there (given, eg., linux usage on azure). Particularly in the recent history of "every day, another shell" on linux/mac. Powershell seems to solve the problem being resolved in rust,go,scala,... over-and-over. Why not just use that?

As a mac user, I was going to provide a flippant answer, but I decided to look into it instead. Personally, I use zsh or a custom built shell scripting library inside swift. Always like to see improvements to shells though. Googled for it and got a dozen guides on how to install it in mac, but none that actually explained how to use it. (One video result looked like it might have some info, but to me that doesn't cou…

You really don’t need any online documentation.

Just use Get-Help and you’re off to the races.

Re: Jeffrey Snower was originally demoted over PowerShell

#35
post #23

I've often wondered why powershell hasnt taken off on linux/mac. I'd guess MS would have a good case for investing there (given, eg., linux usage on azure). Particularly in the recent history of "every day, another shell" on linux/mac. Powershell seems to solve the problem being resolved in rust,go,scala,... over-and-over. Why not just use that?

As a mac user, I was going to provide a flippant answer, but I decided to look into it instead. Personally, I use zsh or a custom built shell scripting library inside swift. Always like to see improvements to shells though. Googled for it and got a dozen guides on how to install it in mac, but none that actually explained how to use it. (One video result looked like it might have some info, but to me that doesn't cou…

Incidentally, I needed to teach myself PS for an azure-focused client of mine -- and I did so on mac (incidentally, making notes in a jupyter notebook with PS backend).

It's a weird language, but I always reminded myself of its competitor: bash -- which is perhaps an order of magnitude more weird.

It feels like it could be a "shell language for the cloud", ie., the language for cross-OS cloud automation work.

Re: Jeffrey Snower was originally demoted over PowerShell

#36
post #23

I've often wondered why powershell hasnt taken off on linux/mac. I'd guess MS would have a good case for investing there (given, eg., linux usage on azure). Particularly in the recent history of "every day, another shell" on linux/mac. Powershell seems to solve the problem being resolved in rust,go,scala,... over-and-over. Why not just use that?

As a mac user, I was going to provide a flippant answer, but I decided to look into it instead. Personally, I use zsh or a custom built shell scripting library inside swift. Always like to see improvements to shells though. Googled for it and got a dozen guides on how to install it in mac, but none that actually explained how to use it. (One video result looked like it might have some info, but to me that doesn't cou…

I'm certain I once wrote a long rant about why I think the concept of PowerShell (using objects instead of text as interface) is interesting but it fell flat on execution and felt like something in the uncanny valley between *nix shells and Python/Perl, with a thousand papercuts. I'm not gonna dig that out, but to add some points I can remember at the moment to yours:

- Write-Output and friends try to be smart and print different things situationally. I hate "smart".

- Try to get something akin to set -e -o pipefail, i.e. exit if a command fails. Pain.

- Try to get something akin to set -x for tracing. There's Set-PSDebug, but the trace level also applies to all the cmdlets, so say you use Expand-Archive, suddenly you have a million lines of crap in your trace you don't give a shit about.

In general, IMO the biggest advantage of PowerShell compared to scripting languages like Python/Perl is the ability to natively interact with Windows' COM stuff. That advantage is nonexistent on *nix.

Re: Jeffrey Snower was originally demoted over PowerShell

#37

I've often wondered why powershell hasnt taken off on linux/mac. I'd guess MS would have a good case for investing there (given, eg., linux usage on azure). Particularly in the recent history of "every day, another shell" on linux/mac. Powershell seems to solve the problem being resolved in rust,go,scala,... over-and-over. Why not just use that?

Powershell runs on Linux and macos too because of .NET Core/5+. The real reason is likely the same sort of people that are still typing Micro$oft in and keep spreading FUD that .NET isn't OS.

The actual real reason is *nix had mature shell scripting many years before powershell was conceived.

For powershell to "take off" on non-Windows platforms, many people need to adopt it and for many people to adopt it, it needs to solve some critical problems the existing solutions don't solve well.

I think pretty clearly, powershell doesn't do that.

(I think I personally would be an easy candidate to use it on Mac... I know/use powershell pretty much daily at my day job -- so there's a minimal learning curve and I still haven't seen any reason to use it on various Mac side projects and jobs. I just do bash/zsh scripts. If it was built in maybe I'd reconsider.)

For myself, I know powershell reasonably well from my day job

Sometimes people will switch to something new just because it's new, but for , generthe new thing has to have some

Re: Jeffrey Snower was originally demoted over PowerShell

#38

Question for the PowerShell afficionados: Do you consider PowerShell to be "something we can count on to exist on Windows systems, in the absence of Bourne-like shells" - or is it "a superior alternative to Bourne shells which only got traction on Windows because Bourne is too deeply embedded in the Unix world"?

PowerShell works on fundamentally different principles than do traditional Unix shells. Unix shells are for loosely coupling small "do one thing and do it well" programs. PowerShell can kinda do this, but its strengths lie in the "object streaming" features which aren't based on external processes at all but on loading .NET libraries with a special API, called cmdlets. In this respect PowerShell is a bit more like the VMS command processor, or using Python or Tcl as a shell. To add a command to a Unix shell, you need but drop an executable in your path. To add a command to PowerShell that takes advantage of PowerShell's features, you need to write a cmdlet in a language like C# and then install the cmdlet. This is also why PowerShell takes so long to boot up: it's probing for and loading installed cmdlets.

For these reasons I do not consider PowerShell to be directly comparable to Unix shells, but it is an essential part of the Windows toolkit because no one wants to use the MS-DOS-like cmd.exe for anything serious.

Re: Jeffrey Snower was originally demoted over PowerShell

#39
post #15
post #12

Earlier quoted context omitted.

Bash as a shell is not so outstanding. It is the gnu tools and the other command line first Landscape. So bash on windows can never fly because these tools are not natively present (cygwin and friends are just awkward). So Powershell (and the new terminal) gives us this whole package with its build-in, service and windows provided commandlets. Consequently: bash will never beat PS on Windows except when someone provi…

On the topic of Powershell on Linux I think the story there could be different, however Powershell violates the core philosophy of Linux so hard (mit vs. GPL, pipe-and-filter vs loaded DLLs, ...) that Powershell will never be something integral and natural fitting there.

[deleted]

Re: Jeffrey Snower was originally demoted over PowerShell

#40

I've often wondered why powershell hasnt taken off on linux/mac. I'd guess MS would have a good case for investing there (given, eg., linux usage on azure). Particularly in the recent history of "every day, another shell" on linux/mac. Powershell seems to solve the problem being resolved in rust,go,scala,... over-and-over. Why not just use that?

Would want to look at how people use Power Shell on Windows and compare to how people use bash/tools/procfs/Python/C on *nix.

I think that, on *nix, Power Shell loses to cli tools/bash/procfs for trivial problems, to Python for simple problems, and to native strongly typed languages for complicated problems.

Many Windows APIs are COM based, for both arguments and results, so an OO-based scripting language is helpful.

Unix APIs tend to be less strongly typed. Mostly lists of lists of strings and ints.

Is there really a recent increase in shells on Linux? I can only think of zsh and fish.

Post reply on HN