Live data from Hacker News

PowerShell is open sourced and is available on Linux

azure.microsoft.com

521–530 of 790 posts

Re: PowerShell is open sourced and is available on Linux

#521

Earlier quoted context omitted.

> So, yes, someone did ask for it - the IT industry. ... who couldn't use the well-known mature shell tools since they were locked into a closed platform, and Windows' cmd.exe was comparatively very weak.

It wasn't cmd that was the problem (although, it is weak); it was how Windows exposed APIs to allow automated solutions. You had two options: VBScript (which is a glorified COM+ agent) or a "real" programming language like VB6/C# which mixed COM+ with Win32 API calls (which are too hard to use for most non-programmers). Powershell within itself does improve CMD. But that isn't primarily how PS pushed Windows automati…

> Powershell within itself does improve CMD.

Kind of depends on how you define improved. I find powershell slow enough that I usually still use cmd unless I'm dealing with a powershell script.

Re: PowerShell is open sourced and is available on Linux

#522
post #483
post #368

Earlier quoted context omitted.

>I can only use this feature by using a .NET language. It goes without saying that a binary interface requires use of a system that understands that particular binary interface. With .NET being open source though, anyone is free to write a bridge to using the objects in COBOL if they wanted to. >I can't take the strongly typed objects into a Node.js script, or a perl script. Yes, because they have no concept of stron…

I guess the point is the point. Potential bridges that do not exist already and probably never will do not matter -- extending that idea of potentiality I could say that you are free to reimplement the CLR in Fortran, so PowerShell is compatible with Fortran? Oups sorry you already reached that ridiculous point, only with Cobol. Virtually any language can already input and output text. That's the real lingua franca o…

>Potential bridges that do not exist already and probably never will do not matter

The difference between impossible and possible is important. Please read what I was replying to. Using your argument, Anytime a project is open sourced, you could reply with "who cares about potential since nobody has actually done anything with the source". Good job.

>Virtually any language can already input and output text.

Um, you seemed to have missed the obvious point that objects can also be converted to text through powershell if the other side can only accept text. So, I don't quite know what you're complaining about. Could you detail your actual technical complaints with powershell, rather than having a philosophical argument?

>That's the real lingua franca of computing (even if it is messy and dirty), not .Net objects...

I don't agree with your opinion, nor with the idea that only a two-choice system can exist.

Re: PowerShell is open sourced and is available on Linux

#523
post #436

Earlier quoted context omitted.

So it's maintained in the open on GitHub, it's technically open source in terms of licensing. Yet you claim it's not really open source. Care to clarify?

It’s technically open-source, that’s the point. There’s more to open-source than license. Sorry but there’s no way for me to clarify without just repeating my original comment.

It is open source in every sense. The development is open, they accept patches/contributions etc.

.net is far more of a true open source framework than android is.

Re: PowerShell is open sourced and is available on Linux

#524

Earlier quoted context omitted.

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…

> 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.

That's not what Graham said. He said, "C#: Java is controlled by Sun", which is quite a bit different from Microsoft not controlling Java.

Microsoft is fine with using and promoting languages they do not control. C++, for example.

The problem with Java from Microsoft's point of view was that Sun did not want people to use Java as a mere programming language. They saw Java as a platform, and wanted people to develop for that platform instead of developing for Windows, or Mac, or Linux, or whatever. Sun wanted all access from Java programs to the underlying facilities of the OS upon which a particular instance of the Java platform ran to go through the Java platform.

Microsoft wanted something with the good parts of the Java language without the baggage and restrictions of the Java platform, and so they made C#.

Re: PowerShell is open sourced and is available on Linux

#525

PowerShell is interesting, and I don't consider it evil. I know some people swear by it, and I am not one of those people - I'll take my AWK with a side of Ruby/Python, and a helping of SCSH, thank you very much. It does seem a bit out of place in a UNIX system, though. In Windows, PowerShell ties to a ton of strongly typed databases (SysReg, &c) and windows APIs together into a nice package. But on UNIXes, those API…

> But on UNIXes, those APIs are already well exposed elsewhere, and that data doesn't exist. I'd go with exposed, but not necessarily well. Examples I run into all the time: get an IP from an interface, change iptables entries, even change fstab options. Sure, if you write enough regex, it will probably work most of the time. But it's never going to be as reliable as get_ips('eth0'), or get_filesystem('/tmp').options…

getting an IP is still pretty ugly, somehow:

  ip address show dev eno1|grep 'inet '|cut '-d ' -f6
But I wouldn't call it unreliable. The cut is the only really nasty bit.

Changing your fstab is easy with a little awk:

  $2=="/tmp"{$4=$4 ",nosuid"}
  {print $0}
Given, it won't remove contradicting options...

Re: PowerShell is open sourced and is available on Linux

#526
post #182

Earlier quoted context omitted.

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.

It looks like they're a little different for now. See the note under here. https://msdn.microsoft.com/en-us/windows/uwp/get-started/ena... Full Disclosure: I am a MSFT employee.

More specifically, I don't want to SSH from a Windows box. I want to SSH into a Windows box (and say figure out a way to easily install a LE cert)

Re: PowerShell is open sourced and is available on Linux

#527
post #93

PowerShell is my guilty pleasure of the computing world. Once you've piped strongly-typed objects around between your shell commands, text scraping seems barbaric by comparison. The problem, of course, is that you can't use all that power for much, since the pool of PS-compatible tools and utilities is much shallower than it is for Unix shells. I'm really hoping this will help spur a new wave of PowerShell-compatible…

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…

There is also GNU Guile, with a fantastically easy to use FFI. Has a great manual too.

Re: PowerShell is open sourced and is available on Linux

#528

Earlier quoted context omitted.

Most users do not find awk trivial. Most people basically use it for {print $colnum} when simple columns are available. PowerShell's integrated query syntax that you can patch into various things is a lot more consistent and reasonable. It is difficult to imagine volunteering people into a world of awk, sed and cut with good intentions in one's heart.

I didn't call awk trivial, I meant to say that the prudent application of powerful tools makes quick work of otherwise intractable problems. Forgive my being frank, please, but I think that given the context of this conversation, it's appropriate: Most users don't HAVE non-trivial problems! There aren't features in sed nor awk, nor regular expressions in general that weren't put there for some specific reason in the…

I think this speaks to the difference in mindset I've seen a lot in this thread. It basically comes down to people who have gained and honed experience with these tools vs. people that haven't. Yes, for someone with a lot of experience with these tools something like Powershell is redundant... for them.

Some people just want to get shit done because this is just a footnote in a task that's a small part of a project. Utilizing gained proficiency in several tools is cool but if you have a choice between doing that and just taking advantage of a simple tool that streamlines things and lets you move on to your next task quickly the correct choice is obvious.

It could be that these tools are better and may be more valuable in some situations but asking someone to spend time gaining proficiency or mastery when another path is available is just premature optimization.

Re: PowerShell is open sourced and is available on Linux

#529

Powershell is a horrible abortion, what the hell do people see in it? I mean that on a language level, I cant speak for Windows specific features. I have once written a simple script to copy a folder recursively to a fileshare, rename some stuff, edit some files. Took me 4-5 hours. I then did it with julia in 30 minutes and I never did anything in either language before that. It's insane the kind of weird language cr…

I wouldn't go so far as to call it a "horrible abortion" - but it can be painful to use at times. I manage several Azure environments with PowerShell and not a day goes by that I don't wish there was something better. Especially on those days when I have to dig into Azure's JSON templates.

There is an SDK for Python, but I haven't had an opportunity to try it. If anyone has used it I would love to hear about your experience.

Re: PowerShell is open sourced and is available on Linux

#530

Earlier quoted context omitted.

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…

Last IronPython release: 2014 Last IronRuby release: 2011

Both of these two projects attempted to solve a problem that very few people have - using .NET libraries from Python and Ruby. In exchange, you had to give up all of your existing native libraries. That is a trade-off that very few people wanted. Source: I started the IronRuby project.

I learned this lesson the hard way a few times in my career - always have respect for people's existing code investments.

Post reply on HN