Live data from Hacker News

PowerShell is open sourced and is available on Linux

azure.microsoft.com

481–490 of 790 posts

Re: PowerShell is open sourced and is available on Linux

#481
post #408

Earlier quoted context omitted.

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 th…

That is not quite right either. I enter about 200 commands on a normal workday and write maybe two scripts a month in a shell language. A shell language should be a shell language, it's not merely a stepping stone to write a script after using a command just once. If that's what I'm looking for I'll use Python. And from the other side, Python would be a terrible shell (by default), and that's fine because that's not…

Windows did ship with VBScript (and probably does still). You can also install languages via a package manager; an example:

- https://chocolatey.org/packages?q=python

Re: PowerShell is open sourced and is available on Linux

#482
I don't understand Microsoft any more. They are making all their proprietary lock-in stuff open source, and they are alienating their user base. I've heard a number of long-term Microsoft users express frustration the user experience (not to mention the Windows 10 upgrade shenanigans). It was bad enough that my dad, a long-time lover of Windows NT (he liked its VMS legacy) switched to a Mac and loves it.

I feel like Microsoft might be pulling a Sun here. However, I'm sure a lot more likely to use Microsoft stuff if I'm not tied in to Windows.

Re: PowerShell is open sourced and is available on Linux

#483
post #368
post #336

Earlier quoted context omitted.

> Could you elaborate on what the actual complexity is, rather than what you imagine? I can only use this feature by using a .NET language. I can't take the strongly typed objects into a Node.js script, or a perl script.

>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 of computing (even if it is messy and dirty), not .Net objects...

Re: PowerShell is open sourced and is available on Linux

#484

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.add('nosuid').

Re: PowerShell is open sourced and is available on Linux

#485
post #436

Earlier quoted context omitted.

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.

There’s more to open-source than license. Such as? You seem to have a mental model of things that make a project objectively open source, that don't include the license. I'd be curious what those things are.

I really don’t, it’s more of a feeling. With an open-source release like .NET it seems more like better documentation. In fact that was the case for early commercial Unixes—you needed the source code to actually use the system, but it wasn’t open-source.

Open-source as-documentation (for lack of better term) is still useful. It makes bug fixing a whole lot easier, for one thing. But it’s not quite the same as open-source ecosystem. For that you need to have a diverse set of actors, sharing the same goal. That’s what I think successful open-source project makes. You need to accept the fact that the project is not just yours. Something like that.

Of course Microsoft could do all those things. Who knows, it they’re determined enough they might turn it around. The problem here is like I said Java is just good enough. No one really cares, except people that could use some better documentation, that have been already invested in the ecosystem. That’s why open-sourcing is still valuable, but also why they’ll never gain any adoption of the kind they’d need.

Sorry if that sounds like rambling, it’s sort of late.

Re: PowerShell is open sourced and is available on Linux

#486
post #79

Great! So I can now run bash on windows (with WSL), open tmux, and open powershell prompts in each tab: the loop is complete! I wish powershell's documentation was a bit more clear about what's powershell 1.0, 2.0, 3.0... Etc. A lot of time I'd find a verbose and tedious way to do one thing because the code was written in "old powershell", when the latest version had a much more elegant solution (either because of ne…

Does tmux work well on Windows? Everything Microsoft has been doing recently with bash on Windows has made me consider buying a surface pro as my next machine.

tmux works quite well. I'm less sure about the surface pro :p

Re: PowerShell is open sourced and is available on Linux

#487
post #98

Is this actually useful? I always thought powershell was largely just for interacting with windows components, like installing an msi or talking to active directory. What would you actually practically use this for on a linux box?

The ramp-up period is much lower with Powershell. It is truly an interactive ("online") environment. Almost everything is typed and through introspection the shell can offer very rich auto-completion hints, without needing tedious scripts such as those used by bash/zsh. Quick example: get- cycles through all get-[whatever] commands, as you'd expect. get-certificate cycles through all parameters available for get-cert…

You can also use things like Get-Command (with options for -Verb, -Noun, -Module filtering) or Get-Member to inspect types/methods/properties. Very helpful when learning a new area.

Re: PowerShell is open sourced and is available on Linux

#488

I don't understand Microsoft any more. They are making all their proprietary lock-in stuff open source, and they are alienating their user base. I've heard a number of long-term Microsoft users express frustration the user experience (not to mention the Windows 10 upgrade shenanigans). It was bad enough that my dad, a long-time lover of Windows NT (he liked its VMS legacy) switched to a Mac and loves it. I feel like…

The main fallacy is to think someone can 'understand' any big corp. Especially Microsoft - http://www.bonkersworld.net/organizational-charts/

Re: PowerShell is open sourced and is available on Linux

#489
post #63

Earlier quoted context omitted.

I feel that principle is true from all high-level languages as you move down the chain. Shell scripts should be 1-20 lines. Python/Ruby/whatever for 20-100 and compiled for anything >100.

I was about to refute you with a recent example of mine that just needed to serially execute a bunch of commands, and it's well over 20 lines. Then I remembered that I needed to introduce some branching logic, said "not in bash, I'm not", and rewrote it in Python. So for me, it's not a matter of LoC but complexity. Need to copy file from here to there, then commit to git repo, blah, blah, blah, then kick off a build?…

For me, the marker point is arrays. Arrays in shell are terrible - if I'm going to need an array, drop shell for something else.

Re: PowerShell is open sourced and is available on Linux

#490

And now PowerShell on Bash on Ubuntu on Windows is a thing. (Spoiler alert, it doesn't work very well right now. The cursor keeps jumping to the top of the console and overwriting existing text.)

If you run it inside of tmux, that issue seems to go away for some reason.
Post reply on HN