Live data from Hacker News

PowerShell is open sourced and is available on Linux

azure.microsoft.com

351–360 of 790 posts

Re: PowerShell is open sourced and is available on Linux

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

Re: PowerShell is open sourced and is available on Linux

#352

Earlier quoted context omitted.

Java seemed to have a lot more options for deployments and monitoring for a long time. More advanced 3rd party libraries in general. It had simply been around longer and thus had those tools available. Now that C# has been standard for a while almost all of those tools have a C# equivalent. As a .NET dev I'd actually argue that the things available to C# now are actually better (especially Visual Studio), but that's…

Meh, to make Visual Studio do IDE-like things, people install things like ReSharper, built by the same people that are building IntelliJ IDEA. And I worked with both and IntelliJ is much smarter, and has support for way more technologies. And yes, it's built in Java and can be sluggish, but then again I'm using it on both Linux and OS X and runs just fine on Windows too, so it doesn't tie me to an OS I don't want. Al…

>Also, I keep mentioning this, but .NET lacks a build tool like Maven or something similar (SBT, Gradle, Leiningen).

You mean in terms of integration with Visual Studio? Because both Maven and Gradle can compile .NET code (msbuild or xbuild). Gradle doesn't natively support Nuget's format, but there are plugins for it.

> .NET is still at the level of Ant / Make and .NET devs don't realize what a huge difference that is.

Gradle just uses javac under the hood.

Re: PowerShell is open sourced and is available on Linux

#353
post #322
post #242

Earlier quoted context omitted.

except that C# as a language is by leaps and bounds better than Java (both in syntax and useful features departments), so there have been other problems to solve, too.

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…

What do you mean by it not being open source? The core CLR is MIT licensed and the compiler is Apache licensed.

This sounds like fud to me.

Re: PowerShell is open sourced and is available on Linux

#354
post #56

Earlier quoted context omitted.

You can use control-O for that, which does "execute this command as if I pressed enter, then when it's done bring up the following command in command line prompt". So if you have a set of commands to run that are 20 lines up in history, you can first find them (with 20x UP or by reverse-search), then just control-O control-O control-O control-O ... to execute them one after another.

Doesn't work in bash running in my Terminal.app on macOS, although it certainly does when I `ssh` into one of my Ubuntu boxes. Wonderful shortcut. EDIT: If anyone knows an easy way to get this working on macOS, I'd love to know it.

Stackoverflow to the rescue: http://apple.stackexchange.com/questions/3253/ctrl-o-behavio...

This turns out to be because on OSX the terminal driver defaults to throwing away control-O which is rather unhelpful of it. "stty discard undef" fixes it.

Re: PowerShell is open sourced and is available on Linux

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

The official cmdlet documentation is versioned, though for some reason it only seems to have versions 3, 4, and 5. Which, agreed is very annoying, since Windows 7 has version 2 by default.

https://technet.microsoft.com/en-us/library/hh849971.aspx

(You should upgrade to at least 3. It has all sorts of useful stuff added! File hashing and web requests at the very least.)

Re: PowerShell is open sourced and is available on Linux

#356
post #157

Earlier quoted context omitted.

The reason I chose that particular example was not for the database integration (which is very cool) but for the fact that it's actually something I did. Point is, imagine trying to grep anything tabular in bash. Hypothetically, the output of ls -la for files with execute permission that have been modified in the last day. Or, more realistically, anything involving ps.

Imagine trying? Sir/Ma'am, I have done so. When boxed in-between the fearsome foursome--`bash`, `sed`, `awk`, and `emacs`--every problem involving tabular data (2D) is trivial. Hm, I'll give a shout-out to `sort` and `uniq`, too! When you go 3D, you might need to bring in `join`. But anyway, you'd use find ~/bin /usr/bin -mtime 1 -executable -type f -ls ..to provide `ls -la` output for every executable, ordinary file…

Most users do not find awk trivial. Most people basically use it for {print $colnum} when simple columns are available.

PowerShell's integrated query syntax that you can patch into various things is a lot more consistent and reasonable. It is difficult to imagine volunteering people into a world of awk, sed and cut with good intentions in one's heart.

Re: PowerShell is open sourced and is available on Linux

#357
post #295
post #272

Earlier quoted context omitted.

What about: ip addr show | grep inet Edit: wrote back original command and replied below instead

But once again, you're simply scraping text, instead of querying an object for properties.

You would have to be aware of that fact in order to write the command. The question is about relative advantage, not about what the tools do.

Re: PowerShell is open sourced and is available on Linux

#358
Windows can have a neat-o shell all they want but when you open powershell on a windows computer you still get the following when you try to ssh... so, not really seeing the point here:

ssh : The term 'ssh' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

Re: PowerShell is open sourced and is available on Linux

#359
post #169

Earlier quoted context omitted.

Okay, I've imagined it. It does seem terrible. Fortunately, that's not a world any of us live in.

Er, it's a world all of us live in. Say, for example, ‘ps’ or ‘ls -1l’. Then you end up using awk, which is rather like a half-assed version of powershell to work around shortcomings with the unix everything-is-a-string design.

Parent comment was talking about parsing the raw output from a database in stdout. That's what I was responding to, and I'm not wrong.

Re: PowerShell is open sourced and is available on Linux

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

No. The well-known mature shell tools manage files and processes - neither of which are a focus of managing a Windows system. Windows revolves around services which you RPC to, which internally store their state - attempting to faff with their state from outside the service is almost always both undocumented and likely to cause failure.

Powershell allowed those services to standardise their RPCs in such a way that sysadmins could call them easily. Alternatively, you'd have COM or a variety of other RPC mechanisms, depending on the service, often undocumented themselves as they were only ever intended to be used by a GUI packaged with the service.

Post reply on HN