Live data from Hacker News

PowerShell is open sourced and is available on Linux

azure.microsoft.com

441–450 of 790 posts

Re: PowerShell is open sourced and is available on Linux

#441

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.

false equivalency

Re: PowerShell is open sourced and is available on Linux

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

Your original comments mostly contained your personal opinions, not actual facts. The fact is that it is open source and you are FUDing.

> Your original comments mostly contained your personal opinions

I never tried to pass it as anything else.

Re: PowerShell is open sourced and is available on Linux

#443
post #110

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 isn't competing with bash, it's competing with Python. So then, how does it compare against Python? While plenty of small scripts are still done with bash, I think Python is pretty common for serious production needs. I use it for virtually all scripting these days. I had a recent experience where a developer spent a day and couldn't get Powershell's webrequest library to do what he wanted. I was able to a…

Sure, there are different ways to do various things, especially depending on what one is familiar with and what the task at hand is. It sounds more like you knew how to get something done with your tools faster than the other guy/gal in this case. :)

Re: PowerShell is open sourced and is available on Linux

#444

Earlier quoted context omitted.

I've been loving using Node.js for scripts. You get all the NPM goodies plus STDIO, and they end up working just as well as shell scripts. One of the big advantages IMO is that I only need to master one language for all of my needs, from browser to server to shell :)

How do you find dealing with async? Virtually everything I'd want to do with scripting would almost certainly be async in node libraries, and while I'm willing to pay the callback / promise tax in production code, for scripts it seems like the convenience of just dealing with everything synchronously would outweigh the advantage of keeping things in one language.

Personally for me I use es2015 and async/await in shell scripts since it's so close to writing sync code to me. I have an alias to my global babel so it's uber easy to transpile and run the code. I right a lot of node code for work so it's just native to me but I'd recommend others look into it. NPM is such an amazing ecosystem for it.

Re: PowerShell is open sourced and is available on Linux

#445
post #61

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?

Scripting. While I typically use Bash on Windows to use grep to interactively test my webserver, I'm much happier using Powershell ISE (which I don't know was ported [1]) to write standard tests with multiple parts, particularly ones that require e.g. checking cookies on the response. 1. Looks like they ported a service that does the same. https://github.com/powershell/powershelleditorservices

I shouldn't comment before coffee - not grep, curl.

Re: PowerShell is open sourced and is available on Linux

#446
post #413

Earlier quoted context omitted.

It wasn't cmd that was the problem (although, it is weak); it was how Windows exposed APIs to allow automated solutions. You had two options: VBScript (which is a glorified COM+ agent) or a "real" programming language like VB6/C# which mixed COM+ with Win32 API calls (which are too hard to use for most non-programmers). Powershell within itself does improve CMD. But that isn't primarily how PS pushed Windows automati…

If all this API effort had gone into a real cross-platform language (Python, Ruby, or even Perl which was king in 2001), Windows would have flourished. They went for their traditional lock-in approach instead, so now they have to catch up.

[deleted]

Re: PowerShell is open sourced and is available on Linux

#447

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…

I don't think it's too late for PowerShell, I think it's too late for UNIX. You need a big CLR ecosystem for this to play out.

If somebody resurrected Midori as a CLR Unikernel I'd be very pleased.

Re: PowerShell is open sourced and is available on Linux

#448
post #23

PowerShell is an improvement on Bash, but I'll still be using F# .fsx files for my .NET scripting needs. That said, the real reason I'm excited about this release is that there's finally a great example of a very large project based on .NET Core [1]! Most other examples I'd seen were pretty small, so this is really helpful. [1] https://github.com/PowerShell/PowerShell

Can you share advantages or powershell improvements over Bash ? or is it kind of over-statement?

Re: PowerShell is open sourced and is available on Linux

#449

Earlier quoted context omitted.

That doesn't sound hard at all. AWK, anyone?

Writing awk to do it is definitely more work than calling obj.Property though.

  $mysql_cmd|awk -F\| '$2 == "what you want the second row to match" {print $0}'
Not that much more work. And you can do better if you can coax mysql to emit proper DSV.

Re: PowerShell is open sourced and is available on Linux

#450

Can I write tools that use PowerShell and .NET objects in non-.NET languages, like Python or Perl (using the C implementations, not a .net python)? Like, is there an API that I can implement to interact to implement PowerShell-like "native" tools?

use pythonnet to interact with .NET dlls from CPython:

https://github.com/pythonnet/pythonnet

Post reply on HN