Live data from Hacker News

PowerShell is open sourced and is available on Linux

azure.microsoft.com

581–590 of 790 posts

Re: PowerShell is open sourced and is available on Linux

#581

Earlier quoted context omitted.

By giving everything away for free? The only related revenue stream M$ seems to have left is Azure with some vague notion that giving away their ecosystem will drive people to use their cloud more

Microsoft does not grow food, build houses, create clothes, cars, or protect you from foreign invaders. The basic human needs are not met by MS. The business that claimed that open-source was a cancer is just a marketing company with memetic feedback loops. Plenty of over Operating Systems are out there. Their office product is no longer relevant (vis. a vis. Libre Office, Google Docs, and others). Are you telling me…

>Their office product is no longer relevant (vis. a vis. Libre Office, Google Docs, and others).

You have no idea just how wrong you are. Excel has no competitor worthy of even talking about. Libre Office is a mess. Google docs doesn't do everything word can and is in the realm of a toy web app.

Re: PowerShell is open sourced and is available on Linux

#582
post #506

Earlier quoted context omitted.

After a number of years using PowerShell, my conclusion is the opposite: text "scraping" is just better for most cases. Normal shell usage means doing a lot of one-shot pipelines incrementally. This is just easier and faster to do when passing text around because you can look at it and not have to inspect some object for it's type and what attributes/methods it provides. Parsing the text is not the problem here (alth…

I'm not entirely convinced that "plain text" is "simple." For one, utf-8 is a variable-length encoding, which can cause all sorts of subtle bugs and sometimes leads to security issues because somebody failed to parse a character correctly somewhere. On top of this, using plain text means that every program has to choose its own control characters, essentially an encoding within an encoding. This is great for readabil…

For one, utf-8 is a variable-length encoding, which can cause all sorts of subtle bugs and sometimes leads to security issues because somebody failed to parse a character correctly somewhere.

UTF-8 is nice in that extended characters, despite consisting of multiple bytes, will never contain a low-ASCII character amongst them. Unless you're dealing with byte offsets, splitting and scanning UTF-8 strings by delimiters works just like ASCII.

because unlike something that encapsulates functionality alongside the data, text input into a program might do anything.

On the other hand, that "encapsulated functionality" is even more hidden and non-obvious. Unlike a stream of bytes that you can easily inspect simply by dumping them into a file, PowerShell objects are far more opaque entities.

Re: PowerShell is open sourced and is available on Linux

#583

Earlier quoted context omitted.

Sigh. I don't even know how to start with this one. I'm a "useful idiot" because I'm interested in making PowerShell work as a proper Debian package, or because I might look into what's required to get it into FreeBSD? Seriously? MS is not a monolith, it's made up of lots of different people with different ideologies and different goals.

I think the parent comment's point, with which you are likely to disagree but haven't fully addressed, is that even the best intentions of developers can only serve the ends of the less noble segments of Microsoft.

Fair enough. I think that falls into the category of "what if someone does something evil with my code?", to which I don't really have an answer.

Re: PowerShell is open sourced and is available on Linux

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

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

> who couldn't use the well-known mature shell tools since they were locked into a closed platform

Yeah, I remember the bad old days, when I'd download that CygWin installer and Windows would just give me the old skull and crossbones and say "You're not allowed to install GNU tools, Sucka!" One time I jailbroke XP and got it installed, but then CMD was all "You can't run grep.exe and sed.exe under CMD, Sucka! Not allowed!" I was so sad that I couldn't use those tools on Windows, so sad.

Re: PowerShell is open sourced and is available on Linux

#585

Earlier quoted context omitted.

All those sysadmins would have been perfectly happy with just a properly working unix like shell.

Yes. Like all those early car buyers would be perfectly happy with faster horses.

Both PS and bash are horses actually.

Re: PowerShell is open sourced and is available on Linux

#587
post #342

Earlier quoted context omitted.

Maybe it went something like "god damn it why can't I ctrl+v to copy, what other ctrl keys are there..."? And now I'm looking at http://ss64.com/bash/syntax-keyboard.html and being amazed I didn't know about / forgot a few of these. It'd be nice to put some of the good ones on a coffee mug, I first learned useful vim commands from a coffee mug...

Nope, because I've never used control-keystrokes to do cut-n-paste. I always use (and love) X-style mouse cut-n-paste and hate that there are no good implementations of it on other OSes.

Dating myself, the way I learned copy and paste was CTRL-insert and SHIFT-insert, and those still work fine in konsole, mate-terminal, most any other half-decent terminal program, and straight text mode outside of X.

Not xterm, but I never use that.

Re: PowerShell is open sourced and is available on Linux

#588

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…

Powershell is aweful

Re: PowerShell is open sourced and is available on Linux

#589
post #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 exp…

Linux ecosystem has a huge amount of different tools and scripts for most of the situation that you can imagine. I'm working with Linux more than 14 years, so I can say that text processing idea is the best way. It's pure KISS principle. If you need just to see something - type a command, for complex operations - awk/perl/python. PowerShell looks ugly because it's something between a programming language and shell. It's not KISS. It's all in one tool.

Re: PowerShell is open sourced and is available on Linux

#590

Earlier quoted context omitted.

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

It's unreliable, because you don't know where you'll find 'inet ' or what's the specific spacing of the output. Also, that's not the ip, because you've still got the cidr attached.

And no, fstab is not easy either. For example it fails for:

    # /tmp has option_blah in order to ...
changing it to:

    # /tmp has option_blah,nosuid in order to ...
Confusing the next person to look at the well intended comment.

It's no impossible to implement fairly reliably, it's not going to take days to do, but you're likely make mistakes. And in both cases you're spawning extra processes instead of just getting the information you need.

PS. also slightly annoying is that everyone is so concerned about the text processing part that barely anyone checks what the tool itself can do. (ip -4 -o a s dev eno1 | awk '{print $4}')

Post reply on HN