Live data from Hacker News

PowerShell is open sourced and is available on Linux

azure.microsoft.com

211–220 of 790 posts

Re: PowerShell is open sourced and is available on Linux

#211

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

I can't speak to Ruby, but Microsoft has an active Python group.[1] Granted, it seems to focus on Visual Studio (which I'm told has excellent Python tooling) and Azure.

[1]: https://blogs.msdn.microsoft.com/pythonengineering/

Re: PowerShell is open sourced and is available on Linux

#212
post #47

Earlier quoted context omitted.

I would say not just the shell but most software

And almost certainly languages, too. For example C++.

As someone who has created templated subclasses with both private and public virtual inheritance, I don't think that's a bad thing. C++ is wildly powerful, but it's a mess, and most people should stick to easily understood idioms/patterns, for the sake of maintenance if nothing else.

Re: PowerShell is open sourced and is available on Linux

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

For programming, I agree. However, Python doesn't work as a system shell; for that, you want something optimized for running commands, without having to wrap them in a function call with a list of arguments as strings.

Re: PowerShell is open sourced and is available on Linux

#214

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…

Elixir's REPL (iex) makes a surprisingly-good environment for "pip[ing] strongly-typed objects around between your shell commands." It could use a form with added convenience magic, the way Pry is for Ruby, but I've managed to do some decent interactive ops work on systems through an Erlang-remote-shell (remsh) connection to an IEx shell.

Re: PowerShell is open sourced and is available on Linux

#215
post #157

Earlier quoted context omitted.

How would that be hard in a *nix shell? mysql > SELECT column_name, data_type, numeric_precision FROM information_schema.columns WHERE table_schema = ? AND table_name = ? AND column_name LIKE "%int%"

The reason I chose that particular example was not for the database integration (which is very cool) but for the fact that it's actually something I did. Point is, imagine trying to grep anything tabular in bash. Hypothetically, the output of ls -la for files with execute permission that have been modified in the last day. Or, more realistically, anything involving ps.

Imagine trying? Sir/Ma'am, I have done so.

When boxed in-between the fearsome foursome--`bash`, `sed`, `awk`, and `emacs`--every problem involving tabular data (2D) is trivial. Hm, I'll give a shout-out to `sort` and `uniq`, too! When you go 3D, you might need to bring in `join`.

But anyway, you'd use

    find ~/bin /usr/bin -mtime 1 -executable -type f -ls
..to provide `ls -la` output for every executable, ordinary files (not directories, which are often +x) modified in the last 24 hours, under the directories /usr/bin or the bin/ under your home directory.

:)

Re: PowerShell is open sourced and is available on Linux

#216
post #35
post #17

Earlier quoted context omitted.

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…

It seems weird that the feature of PS that you're most impressed with is something so... trivial? You have full access to your history in both shells so you could easily emulate that feature in bash/zsh or you could create a special binding to run all commands from a point in your history so you only have to press Enter once.

I actually think the basic windows command line that does it, as I was never in the habit of installing PS while on Windows.

Re: PowerShell is open sourced and is available on Linux

#217
post #24
post #17

Earlier quoted context omitted.

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…

Or just be sane and use ctrl-r and search.

I do use this too.

Re: PowerShell is open sourced and is available on Linux

#218
post #51
post #5

Microsoft is projecting that the .NET ecosystem will become a main revenue driver, regardless of the underlying operating system.

Which is why I have no doubt the Universal Windows Platform will become the Universal Platform and be a true desktop/tablet/mobile/server/etc Java competitor on all major OS (mobile, traditional and server). It must be rather frustrating for Microsoft to look back a decade or more and see they were sitting on the exact technology a hell of a lot of people said would be their future had they made it cross-platform fro…

I think this can be explained by the fact that Microsoft has a long history of trying to kill OSS software and alternatives to it's virtual monopoly in the desktop OS market, killing innovation across many technology sectors in the process. Being cross-platform was the opposite of their goals. They specifically created their own version of open technologies and promoted them as the best/only way of doing things on windows - see directx/opengl, and mictrosoft intentionally degrading opengl performance on windows in order to hurt the OSS community.

http://blog.wolfire.com/2010/01/Why-you-should-use-OpenGL-an...

Re: PowerShell is open sourced and is available on Linux

#219

Earlier quoted context omitted.

Except that they added a bunch of new warts that don't have any relation to CMD.EXE. They took the opportunity to re-invent how a shell works from the strongly-typed object perspective but then they copied some of terrible syntax of 40 year old unix shells. I just don't understand it. I'd rather write scripts in pure C#.

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

That is not quite right. At the end of the day it is all about automation. But we took the position that the way Admins automate is by scripting the things that they do in an interactive shell. Bruce Payette had a great way of saying it - he said that the lifecycle of 99% of scripts starts at the prompt and ends at the carriage return. Then, somethings you want to codify things so you put it into a script. Then as the function becomes more used and more important, you want to make it more and more formal without having to throw everything away and start with a new language.

So YES and interactive shell is important but it is important as a stepping stone to automation.

That is the PowerShell mindset. Jeffrey Snover [MSFT]

Re: PowerShell is open sourced and is available on Linux

#220

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…

C# incidentally solved many other shortcomings with Java. The languages are getting closer to parity, but for many years C# was pretty far ahead (if you only consider language features and not tooling/ecosystem). Between reified generics, better native interop, and many functional features, C# felt and feels more concise than idiomatic Java. And I've written plenty of both.

Disclaimer: MSFT employee expressing personal views

Post reply on HN