Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
There's also xonsh[1], which is like a Python REPL and bash rolled into one.
I know, I still use Windows for the time being. However there are still cases where it isn't as good as batch programs. Like Windows' task scheduler, you can't add PowerShell script to task scheduler without command prompt appearing [1]
For me, I switched over to Powershell Core, and as far as I'm concerned, it's way more productive for building situated software than the same gaggle of scripts.
param statements get you auto-complete, and docs. Powershell can just ingest and deal with JSON, and are one module away from doing the same with YAML.
Using % and ? (aliases for 'Foreach-Object' and 'Where-Object') ends up working very well for most data manipulations that one might be interested in.
It definitely has it's quirks as a language, but so does literally every shell in remotely common use.
And I'd say that Powershell is appropriate for non-trivial scripting use, as long as you familiarize yourself with the conventions for handing data to/from functions vs pipelines.
I've written more than one piece of above ad-hoc software in Powershell, though this is the only one I have in public: https://github.com/yumaikas/psi.
Powershell is a weird beast for sure.
Takes care of the parsing and makes pipelines less brittle for sure (just look at things like NO_COLOR [0] that are basically "please adopt this so we can stop having to add endless edge cases to strip ansi color codes") because it keeps data flowing between programs into a machine-friendly format. It's only when it reaches a human that it is formatted for a human to see.
Then when you peel off the surface you realize you can invoke C# directly from the shell. That's right, either you can import any C# .dll out there and call it from the shell or flat out write C# in your script and have Powershell execute it at runtime [2]. You can add syntaxic sugar to make your dll easier to work with but any C# dll can be called from powershell.
As a side effect, this means that if you have a front-end/back-end app with the back-end written in C#, you also have a (bad) scripting interface basically for free.