Live data from Hacker News

PowerShell is open sourced and is available on Linux

azure.microsoft.com

71–80 of 790 posts

Re: PowerShell is open sourced and is available on Linux

#72
post #47
post #37

Earlier quoted context omitted.

I get the feeling that most users have only accessed 5% of the features available in their unix shell of choice

I would say not just the shell but most software

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

Re: PowerShell is open sourced and is available on Linux

#73

I've been hoping for a fully-featured Linux version of Powershell for a while, very awesome. I've used various Linux distributions for a long time and find bash very practical usually, but when I started learning Powershell when working in Windows environments I've been impressed with how easy it was to do some powerful stuff, and felt conflicted since I wanted to be able to use similar functionality and scripts acro…

Powershell really became interesting for me recently. I was working on diagnosing a production issue where one of our win32 applications failed on loading a .net assembly (dll). The error messages weren't terribly useful, and I wasn't getting a good stack trace. While Googling around, I found out that you can randomly instantiate .net objects from the PS command line. A few commands later and I had a full stack trace indicating the problem.

Re: PowerShell is open sourced and is available on Linux

#74

Wow. I've been very impressed with Microsoft lately. They could have easily set themselves up as the next IBM, in the sense of being a monolithic corporation relying on corporate practices, but they've been spewing some crazy fun things that shows they're not out of the league yet. Might just be MY miscontrued perception that microsoft was becoming old/monolithic, but really excited with the direction they are headin…

I speak only for myself.

Microsoft have been hugely focused on hiring people who have experience outside the Windows bubble, and have been encouraging cross-pollination of ideas with the OSS world. There are holdouts for the old guard of course (there's still a BU that requires Windows Phones), but I think everyone knows that the Microsoft of old cannot compete today by bringing an attitude that pleasing the CFO is all that matters. There are techies in the boardroom now who are familiar with the early-mover advantages of free software and the importance of the OSS culture to their workers.

So when a company of massive resources, who can see the writing on the wall, decides to hire thousands of people who actively disbelieve in the value of monolithic lock-in and who enjoy using open-source tools, and empowers them to build interesting things without regard to company loyalty, the result is Powershell on Linux and Bash on Windows. Oh, and a whole lot of goodwill amongst the people you had previously alienated.

Re: PowerShell is open sourced and is available on Linux

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

Yup, I've been playing around with C# more lately and it's such a good language.

Things like embedding with native code is trivial compared to Java. Want to call a delegate(with extras) from a C function pointer? Sure thing, just specify some syntax and away you go. Marshalling strings? Just works.

Totally a breath of fresh air compared to the mess that is JNI.

Re: PowerShell is open sourced and is available on Linux

#76

Wow. I've been very impressed with Microsoft lately. They could have easily set themselves up as the next IBM, in the sense of being a monolithic corporation relying on corporate practices, but they've been spewing some crazy fun things that shows they're not out of the league yet. Might just be MY miscontrued perception that microsoft was becoming old/monolithic, but really excited with the direction they are headin…

Very much so. They're returning to their roots(winning over developers with world-class tools) and it's really refreshing to see. Between this, VSCode and .NET Core it really is an impressive effort.

Let's hope the awesomeness they are showing on the developer relations side finally leaks into the Windows side and they stop their shenanigans with W10 and Android and VFAT patent threats. It's so disappointing to see this kind of split-brained behavior.

Re: PowerShell is open sourced and is available on Linux

#77

Finally! I love the methodology behind PowerShell. It's more verbose than bash, and that's OK to me. The readability and _consistency_ far outweigh the extra characters. Now, I get that coupled with all the flexibility of *nix tooling. It's going to be a long road to hook everything up, but this has the chance to finally standardize command parameters. I'm sorry. This is truly amazing to me and I'm quite excited!

I Can Only See One Problem With PowerShell :)

So, that's kind of the beauty to me. For long lived scripts I can always type out `ForEach-Object { ... }`. When I'm ad-hocing there's always `%{ ... }`.

Bash is a strange beauty, but part of that beauty is how arcane it can be. Generally, people use the smallest parameter possible in scripts instead of the full name. While this can definitely continue with PS, the community has decided on "alias for ADHOC and Full-Name for scripts". This helps the readability tons if someone hasn't memorized all the command parameters.

Re: PowerShell is open sourced and is available on Linux

#78
post #57
post #39

Earlier quoted context omitted.

Objects are discoverable in powershell. Enter the object, and lists the object out as text.

Ok, that sounds good. But what if some developer decided that some field would have prefix "ABC" in all values, then the value I am interested in, then some value I am not interested in at the end? (you say this can't happen? Clue: WMI.) Can I take the value, convert it to string, make some magic on it and convert it to another object entirely? I don't know, I never had any problems with text parsing. I love strong t…

> "But what if some developer decided that some field would have prefix "ABC" in all values, then the value I am interested in, then some value I am not interested in at the end?"

I don't see why this would be a problem for PowerShell. Just use Select-String to strip away the characters you're not interested in. The advantages that derive from passing around objects aren't based on all data being automatically in the format you want.

Re: PowerShell is open sourced and is available on Linux

#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 new language features or simply more cmdlets were added, removing the need to fall back to some C# syntax)

On stack overflow it often means read more than the chosen answer, somebody would have added a newer way to do it. I wish Microsoft "hey script guy" blog had some versioning info (this post was last updated in 2016, using powershell 3, see powershell 2 version here)

Re: PowerShell is open sourced and is available on Linux

#80
post #28
post #14

I'm glad that Microsoft is doing stuff like this. But, I can't imagine a lot of Linux users are going to want to use it. As a former Windows developer I always found Power Shell to be lacking in nearly everything I wanted to do on the command line, in fact, I mainly did shell commands on a remote Ubuntu server.

Would you mind elaborating on Power Shell's lack? I've never used it so I'm curious to know more.

I think the most succinct way of describing it is that UNIX tooling is scatterbrained and at times a little ugly, but each command exits because it solved someone's real-life problem. PS by comparison is a set of tools that try to be all encompassing and solve problems MS devs think people will have.

Our PS repository is full of scripts that do nothing but abstract PS into useful high-level actions.

Post reply on HN