Live data from Hacker News

PowerShell is open sourced and is available on Linux

azure.microsoft.com

291–300 of 790 posts

Re: PowerShell is open sourced and is available on Linux

#292

Powershell is the first language where I managed to save time by writing a program for a task. Needless to say, I'm thrilled at the prospect of using it on Linux. The only thing that I hope they will need to work on is startup time making sure it performs well on low-spec servers (It can be a bit slow starting cold on older laptops). ls -Recurse | ? { $_.Name -match ".+docx" }

I am not sure what your example does. How does it differ from find . -name " .docx" ls -Recurse | ? { $_.Name -match ".+docx" } And, if these are the same, why type in twice as many characters as a command? Actually, ls -R | grep "\.docx$" is, I think, closer in spirit. Now, the issue is things further in the pipeline, I imagine. The find solution allows selection on type name, type, date, depth, mounts, properties,…

If you're just talking about ls/dir, then PowerShell isn't really a win. The advantages are clearer when you start talking about lots and lots of commands. A lot (but not all!) Unix tools have flags to control their output format or input filters, but that means you have to memorize different flags for all of them. OTOH, in PS you just pipe to where/sort/select and they work for everything. IMO PowerShell has better separation of concerns.

Re: PowerShell is open sourced and is available on Linux

#293
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…

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

How are Python/Ruby/Perl going to give you structured objects from "ps"?

That's the promise of object-based pipes. You can get useful records out of your command-line tools without having to write an ad-hoc regex.

Re: PowerShell is open sourced and is available on Linux

#294
post #290
post #275

Earlier quoted context omitted.

That doesn't work on my CentOS box. [kapil@localhost ~]$ ip addr show | grep inet inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host inet 192.168.128.236/24 brd 192.168.128.255 scope global dynamic eth0 inet6 fe80::215:5dff:fe80:501/64 scope link [kapil@localhost ~]$

Correction then: ip addr | grep "inet " | cut -f 3 -d " "

It still doesn't work (you forgot to add the tr back in your reply after your edit)

  [kapil@localhost ~]$  ip addr | grep "inet " | tr -s " " | cut -f 3 -d " "
  127.0.0.1/8
  192.168.128.236/24
  [kapil@localhost ~]$

To be honest, I don't consider this to be that bad, I was just replying to a person who thought that bash was "simple", and powershell was "complex". Also, I don't have a problem with either tool. I'm very open to the idea that Microsoft can and does create awesome tech, despite having other shitty products.

Re: PowerShell is open sourced and is available on Linux

#295
post #272
post #256

Earlier quoted context omitted.

Could you elaborate on what the actual complexity is, rather than what you imagine? For a developer writing a tool, exposing an interface as objects is far easier than having to constantly serialize data into a string. Keep in mind that once you serialize data into a string, you can never change the order of the data or else other tools will break. Not so with a object based interface. In other system-admin type task…

What about: ip addr show | grep inet Edit: wrote back original command and replied below instead

But once again, you're simply scraping text, instead of querying an object for properties.

Re: PowerShell is open sourced and is available on Linux

#296

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…

>I'll bet that "open source" doesn't mean to MS what it means to the open source world.

Before Satya Nadella took over it didn't. Now it mostly seems to.

Re: PowerShell is open sourced and is available on Linux

#298
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…

FYI IronRuby never made it into a usable state, never came close to other implementations like JRuby or Rubinius and IronPython hasn't received an update since the end of 2014, which for an open-source project like a language implementation means it's nearly dead.

That said adopting Ruby or Python as a shell language wouldn't make sense. Especially Python with its white space aware syntax, I mean can you imagine piping commands at the command line using Python, as I can't. These languages haven't made it as shell replacements in UNIX either, even though everyone complains about Bash.

Re: PowerShell is open sourced and is available on Linux

#299
post #182

Earlier quoted context omitted.

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.

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.

Re: PowerShell is open sourced and is available on Linux

#300
post #232

Earlier quoted context omitted.

[Disclaimer: I work for Microsoft.] As far as I recall, the original impetus behind what became PowerShell (as handed down to us in a conference room by Ballmer himself, sometime around 2001) was to fill the gap between ops people who did enterprise administration manually with tools like MMC and engineers who automated enterprise administration with tools like C++/DCOM. The latter were necessary in a lot of cases, b…

I read this a while back. It's an interview with the dude who wrote PS https://www.petri.com/jeffrey-snover-powershell

His HN handle is JeffreySnover; He is commenting on this story at this moment.
Post reply on HN