Live data from Hacker News

PowerShell is open sourced and is available on Linux

azure.microsoft.com

181–190 of 790 posts

Re: PowerShell is open sourced and is available on Linux

#182

Earlier quoted context omitted.

This is what I have been waiting for right here!

yup, me too!

I think it might have rolled out already. Turn on Developer Mode in Windows 10 Anniversary Edition, and ssh to port 22 with a valid l/p?

Doesn't look like you even need to install WSL.

Re: PowerShell is open sourced and is available on Linux

#183
post #49

Earlier quoted context omitted.

Bash is awful. But so are shells in general. Even Rob Pike says as soon as your shell program gets longer than a few lines, write it in a proper language.

Citation please? I would love to share this with some of my coworkers.

I can't find it anywhere, I have tried.

I think it is in the plan 9 mailing list - 9fans, as that is where I have interacted with Rob

Re: PowerShell is open sourced and is available on Linux

#184

Earlier quoted context omitted.

I love the strongly-typed cookies but I absolutely hate the powershell syntax. It's like C# and Bash got together and had a really ugly baby.

The implicit return semantics are insane, since you can implicitly early-exit when you do things like call ArrayList.Add (which returns a bool to indicate whether the thing was added).

I know the problem you are talking about - it has bitten all of us.

The new language mode you use when writing classes in PowerShell shifts the needle more towards programming semantics than shell semantics and addresses this.

Give it a try!

Jeffrey Snover [MSFT]

Re: PowerShell is open sourced and is available on Linux

#185
post #93

Earlier quoted context omitted.

As a note, there have been strongly-typed shell languages for Unix for some time. Scheme Shell[0], Turtle[1] and TCSH[2] leap to mind; but there's nothing preventing a developer from using Perl, Python, Lisp or any other language that allows itself to accept stdin as an interpreted script. 0: https://scsh.net/ 1: http://www.haskellforall.com/2015/01/use-haskell-for-shell-s... 2: http://www.tcsh.org/Welcome Edit: oh m…

This is why I find PowerShell to be an answer to a question nobody asked. If bash/zsh isn't cutting it for you, drop into something like Python, Ruby or Perl to do the heavy lifting. PowerShell will never accumulate a library as comprehensive as what any of those three have, each has had decades to accumulate packages of all kinds, and more are still being added. It's odd, but not surprising given their history of "N…

I feel very similarly, but then I'm of the mind that if I can't apt-get it, I'm not interested, and I'll bet that "open source" doesn't mean to MS what it means to the open source world.

As for the NIH syndrome, one of my favorite Paul Graham essays is still "What Languages Fix" (http://www.paulgraham.com/fix.html) particularly for C#: the problem that C# was invented to solve is that Microsoft doesn't control Java.

Re: PowerShell is open sourced and is available on Linux

#186
post #93

Earlier quoted context omitted.

As a note, there have been strongly-typed shell languages for Unix for some time. Scheme Shell[0], Turtle[1] and TCSH[2] leap to mind; but there's nothing preventing a developer from using Perl, Python, Lisp or any other language that allows itself to accept stdin as an interpreted script. 0: https://scsh.net/ 1: http://www.haskellforall.com/2015/01/use-haskell-for-shell-s... 2: http://www.tcsh.org/Welcome Edit: oh m…

I want to throw my support behind scsh! It's useful for those things that cross the boundaries between a program, and a shell script. I've found once you need functions for a shell program, it's time to step up to scsh. I also wish scsh ports were more well maintained so people could use their favorite schemes with scsh syntax, but it's quite a large codebase to port, so remember that it's scheme48 scheme.

I thought I was the last person using scsh!

Now if I could just imbue my coworkers with your good taste....

Re: PowerShell is open sourced and is available on Linux

#187
post #17
post #9

I'm always in favor of things being open-sourced, but I do kind of wonder in what universe I would use PowerShell when Bash is readily available.

As a full-time Linux user, I have to say that bash is overrated. For instance, on Windows I could press the up arrow through my history 20x to find a group of commands I want to run, press Enter, then press DOWN for the following command, then enter, then DOWN until I run them all. In Bash, I need to press UP 20x every single time. Yes, you can customize it a lot, and you can script it but default bash isn't that spe…

For the record - the PowerShell team loves Bash and much of PowerShell is modelled after it. To be fair - we also modelled portions after VMS DCL, Perl, TCL and AS400 CL. There are lots of awesome engineers out there working on different platforms and we learned a lot from of them. Jeffrey Snover [MSFT]

Re: PowerShell is open sourced and is available on Linux

#188

Earlier quoted context omitted.

The point of PowerShell isn't just to write scripts but to work as an interactive shell.

I'm not at all convinced that the syntax is any better for typing in as commands in an interactive shell.

I think it works pretty well for that beyond the weird omission of anything like &&

Re: PowerShell is open sourced and is available on Linux

#189

Earlier quoted context omitted.

Well it isn't a hard limit. I am okay with a 25 line script for example ;) Well really you are more right than me. It is about complexity more than the number of lines. However for the most part the longer something is the more complex it is to work with even if it does something simple. Managing a 1000 line bash script is almost certainly going to be more painful than doing it "properly" in Python or Java or whateve…

It mostly comes to do this for me "is this thing going to be something I need to understand and manage outside of my own little bubble?" if it is then I want it to be better designed/maintained. Thanks for taking the time to reply. And you're right, even I wouldn't want to maintain 1000 lines of serially-executed commands, meaning I have a line limit somewhere as well. So maybe a mix of complexity, and at some point…

Everyone has their own way of working :) I first got into things with batch files on Windows 95 and quickly realised how awful they are when more than 5 lines! I quickly moved on to their Windows Scripting Host stuff which was better but still painful. Then VB6 then C++/MFC.... The usual Windows user story.

Scripting on Unix is a lot better but it is only recently that places seriously use VCS for scripts in my experience so before the days of Git if you wanted to do anything with an iota of manageability it meant you did it in a "real" language hehe.

Re: PowerShell is open sourced and is available on Linux

#190

Earlier quoted context omitted.

Not if you're in a script and declaring a function. So, no, it's a source of confusing bugs. Implicit return works better in, like, Ruby, where it has to be at the end and can't just randomly exit in the middle of a function declaration.

ArrayList.Add ... whatever ... | Out-Null Its not implicitly returning. The return value wasn't assigned so it is emitted to the pipeline.

OK, sorry (there is an explicit "return" keyword that I thought worked the same way). Either way, yes, I know you can avoid it by piping to Out-Null, but that behavior is surprising.
Post reply on HN