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 love the strongly-typed cookies but I absolutely hate the powershell syntax. It's like C# and Bash got together and had a really ugly baby.
PowerShell is open sourced and is available on Linux
161–170 of 790 posts
Re: PowerShell is open sourced and is available on Linux
#162Earlier quoted context omitted.
Imagine for a second that the DB can't do it and you need to filter the STDOUT output.
Okay, I've imagined it. It does seem terrible. Fortunately, that's not a world any of us live in.
Re: PowerShell is open sourced and is available on Linux
#163Earlier quoted context omitted.
The implicit return semantics are insane, since you can implicitly early-exit when you do things like call ArrayList.Add (which returns a bool to indicate whether the thing was added).
insane in a good way right? You aren't "returning" you are emitting to the pipeline
Re: PowerShell is open sourced and is available on Linux
#164https://channel9.msdn.com/Shows/msftazure/Run-PowerShell-Nat...
Re: PowerShell is open sourced and is available on Linux
#165Earlier quoted context omitted.
This is why I find PowerShell to be an answer to a question nobody asked. If bash/zsh isn't cutting it for you, drop into something like Python, Ruby or Perl to do the heavy lifting. PowerShell will never accumulate a library as comprehensive as what any of those three have, each has had decades to accumulate packages of all kinds, and more are still being added. It's odd, but not surprising given their history of "N…
Powershell can use any .NET library... "Nobody" meaning you. Which is perfectly fine. But there are quite a few users of Powershell out there.
Re: PowerShell is open sourced and is available on Linux
#166Earlier quoted context omitted.
insane in a good way right? You aren't "returning" you are emitting to the pipeline
Not if you're in a script and declaring a function. So, no, it's a source of confusing bugs. Implicit return works better in, like, Ruby, where it has to be at the end and can't just randomly exit in the middle of a function declaration.
Its not implicitly returning. The return value wasn't assigned so it is emitted to the pipeline.
Re: PowerShell is open sourced and is available on Linux
#167And 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.)
Re: PowerShell is open sourced and is available on Linux
#168Can 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?
If you're talking an FFI though, not so much, I think.
Re: PowerShell is open sourced and is available on Linux
#169Earlier quoted context omitted.
Imagine for a second that the DB can't do it and you need to filter the STDOUT output.
Okay, I've imagined it. It does seem terrible. Fortunately, that's not a world any of us live in.
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.
Re: PowerShell is open sourced and is available on Linux
#170Earlier quoted context omitted.
> Quick, easy. In a *nix shell that would be very tricky. You'd probably need to make an explicit SQL query since you wouldn't have the database integration.
Well, yeah, but I mean the concept (grepping in tabular data). If, hypothetically, bash had database integration, ls Columns would probably return something like foo varchar 30 NOT NULL bar decimal 8 baz int 4 Which would be a royal PITA to search for anything in—if I were to search for ‘int’ I'd get all int columns and any columns with int in the name…. I could've used an example involving process lists, but I didn'…