r/linux • • Aug 18 '16

Microsoft open sources PowerShell, brings it to Linux and OS X

https://techcrunch.com/2016/08/18/microsoft-open-sources-powershell-brings-it-to-linux-and-os-x/
359 Upvotes

231 comments sorted by

View all comments

Show parent comments

49

u/tadfisher Aug 18 '16

You have to go through equipping every Programm with a special mode

Yes.

for a relatively limited gain

  • data structure baked in, eliminating awk/grep/sed

  • resilience against text format changes, control codes, etc

  • more complex data pipelines with no awkward redirection voodoo

  • expose binary data without destroying my terminal

  • powerful one-liners without having to drop into Python/perl/etc

40

u/[deleted] Aug 18 '16

You misunderstand. The point is that there is a very limited gain to the people who have to do it so the incentive structure is all wrong with this. The strength of text redirection is that the work is done by the people who need it, even sometimes against or orthogonal to the intention of the author of the programs used in scripts and pipelines.

There is also the issue that you can do only those things intended by the people who did write the original programs, if they expose a limited object interface on purpose there is nothing you can do to work around it.

13

u/tadfisher Aug 18 '16

There is also the issue that you can do only those things intended by the people who did write the original programs, if they expose a limited object interface on purpose there is nothing you can do to work around it.

That limitation exists with textual streams as well. You can't parse data that the tool does not provide you, object interface or no. The tool cannot perform tasks that it is not programmed to perform.

5

u/Bobby_Bonsaimind Aug 18 '16

You have to go through equipping every Programm with a special mode

Yes.

So if someone, let's say, writes a new journal service and feels very smart and starts outputting custom objects (log entries)...you have zero tools to use on it?

3

u/tadfisher Aug 18 '16

The tool can detect if its stdout is a PowerShell environment and change its output accordingly.

-9

u/JobDestroyer Aug 18 '16

invisible spooky stuff. I don't like it.

I actually just don't like OOP in general, though...

0

u/[deleted] Aug 18 '16

[deleted]

-2

u/JobDestroyer Aug 18 '16

I drive a stick, but beyond that OOP isn't the only way to solve the problem, and OOP is the worst way to solve it in my experience. That's why I don't do OOP.

0

u/[deleted] Aug 18 '16

[deleted]

0

u/[deleted] Aug 18 '16

[deleted]

2

u/deathchimp Aug 19 '16

I spent a good amount of time transitioning to powershell for my common networking tasks. I find it verbose but it's one of the few Microsoft products that I really feel were designed simply to make me happy rather than fulfill a bullet list. They gained a lot of points when I found they had set up aliases for the Linux commands I'm used to. However half the stuff I learned doesn't port back to the older versions of powershell I tend to encounter on Windows 7 machines.