Live data from Hacker News

PowerShell is open sourced and is available on Linux

azure.microsoft.com

381–390 of 790 posts

Re: PowerShell is open sourced and is available on Linux

#381
post #350
post #322

Earlier quoted context omitted.

Its ecosystem isn’t. C# will never get accepted as an open source product. It only has open source code, it’s not actually ‘open-source.’ Compare it with Typescript, which—despite originating from Microsoft—is a truly open project, and getting love left and right. C# might be better than Java/JVM, but it’s not better enough. The culture/ecosystem barrier is so high that C# would have to be miles ahead, technically su…

i have a hard time with this argument. on one hand what you say is true: C# is a strictly smaller community than java. OTOH that's true of pretty much any language, and yet python, ruby, elixir, swift, golang, etc. communities are healthy and vibrant. if what you really mean is 'java people won't switch to C# anyway', then i agree, but C# isn't a really a language for them. it's a language for people who don't like a…

As if C# were any less driven by PHB-dictated internal enterprise mandates than Java is.

Re: PowerShell is open sourced and is available on Linux

#382

Is there anything preventing Microsoft from putting a Linux shell natively on Windows? I'm sure PowerShell is awesome, but the DevOps person in me is not excited at all.

Not quite what you're looking for, but arguably better: https://msdn.microsoft.com/en-us/commandline/wsl/about

Been playing with it ever since I got a new Windows laptop for college (I usually would have installed Debian but I prefer OneNote to notetaking apps on available on Linux). The interesting part is that it's not a VM; the LoW subsystem translates Linux syscalls to Win32 ones

Re: PowerShell is open sourced and is available on Linux

#383

Earlier quoted context omitted.

I think it works pretty well for that beyond the weird omission of anything like &&

It works fine as an interactive shell but that's not exactly high praise. It could be better for that and for scripting but instead tries to be more familiar to bash users. As a bash user, I'm terribly happy about it's syntax either but it's the price to pay for 40 years of backwards compatibility. Powershell has no such excuse.

True enough.

Re: PowerShell is open sourced and is available on Linux

#384
post #317

Earlier quoted context omitted.

OK, sorry (there is an explicit "return" keyword that I thought worked the same way). Either way, yes, I know you can avoid it by piping to Out-Null, but that behavior is surprising.

return {expression} is equivalent to {expression} return the only place you have an exit from a function, script block or similar is either at the end or at a return statement. Every value that isn't assigned or piped into nirvana gets pushed to the pipeline. I actually can't remember having used return statements more often than once or twice so far (and I use PowerShell daily, heavily). Then I rarely found the need…

Most people writing PowerShell scripts are likely dabblers though. Anyway, I have to admit I don't really appreciate the whole pipeline idea; I just know that `$something = Some-Function` sometimes wouldn't do what I thought it would because of these semantics.

Re: PowerShell is open sourced and is available on Linux

#385

Earlier quoted context omitted.

Imagine for a second that the DB can't do it and you need to filter the STDOUT output.

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

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

Re: PowerShell is open sourced and is available on Linux

#386
post #335

I am still trying to understand if there are any tangible benefits on learning powershell over bash/zsh.

I wouldn't think of it as a replacement for bash/zsh or other shells. Those are meant to control the OS and run programs where powershell is an environment to programatically interact with API's. They can both fill similar roles but their not the same.

Re: PowerShell is open sourced and is available on Linux

#387

Earlier quoted context omitted.

I have to agree. I can only feel like this is pollution or another EEE attempt.

Tell me how well EEE works with an optional application released on Github with an MIT license will work.

GitHub is just the distribution here, and software licenses are subject to change. That's the embrace portion.

Hypothetically, Powershell becomes widely used on Unix, and Microsoft releases Powershell 2, which extends Powershell. This version only runs on Windows and contains killer features. These new features can't be implemented from the GitHub source either technically or because of intellectual property. That's the extinguish step.

Re: PowerShell is open sourced and is available on Linux

#388
post #17

Earlier quoted context omitted.

As a full-time Linux user, I have to say that bash is overrated. For instance, on Windows I could press the up arrow through my history 20x to find a group of commands I want to run, press Enter, then press DOWN for the following command, then enter, then DOWN until I run them all. In Bash, I need to press UP 20x every single time. Yes, you can customize it a lot, and you can script it but default bash isn't that spe…

If you put this in your `~/.inputrc` [1]: "\e[A": history-search-backward "\e[B": history-search-forward "\e[C": forward-char "\e[D": backward-char you can start typing a previous command and go up through your history for all commands starting with whatever you currently have typed into the bash shell. Reset the scrolling through the history with `ctrl+c`. Personally, I hate that powershell remembers your position i…

Exactly, but it makes more sense to bind history-search-backward and history-search-forward to and in my opinion.

Re: PowerShell is open sourced and is available on Linux

#389

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…

Care to post a few simple powershell examples that do the sorts of things those familiar with typical nx shell scripting might find useful?

Re: PowerShell is open sourced and is available on Linux

#390

Having powershell + bash on linux lets me compare this way: powershell, 14 pids(threads?), 3119M Virt size, 80160kb Resident. bash, 1 pid, 22068kb Virt, 3976kb Resident. And this is simply starting the process to an idle prompt. This is on a Debian 8 64bit system. (using their Ubuntu 14.04 binary)

I'm not a huge fan of PowerShell but you're not really making a good comparison here. Bash is "just a shell" that executes commands with a few bits of syntactic sugar here and there to make it easier to string those commands together and perform some primitive logic. PowerShell is basically an interpreter that works more like a Java Virtual Machine. Consider the hypothetical example that you need to lookup 100 users…

I fully agree -- they're two different animals. IMHO, it's a symptom of the two different paradigms of running a process on Windows vs Unix.

I worry about getting out of the habit when scripting on Linux of forking off a new process for each iteration of a loop, rather than pushing the loop into powershell, for better execution.

Post reply on HN