2 ms·
I'm certain I once wrote a long rant about why I think the concept of PowerShell (using objects instead of text as interface) is interesting but it fell flat on
by oefrha 5y ago
I'm certain I once wrote a long rant about why I think the concept of PowerShell (using objects instead of text as interface) is interesting but it fell flat on execution and felt like something in the uncanny valley between *nix shells and Python/Perl, with a thousand papercuts. I'm not gonna dig that out, but to add some points I can remember at the moment to yours:
- Write-Output and friends try to be smart and print different things situationally. I hate "smart".
- Try to get something akin to set -e -o pipefail, i.e. exit if a command fails. Pain.
- Try to get something akin to set -x for tracing. There's Set-PSDebug, but the trace level also applies to all the cmdlets, so say you use Expand-Archive, suddenly you have a million lines of crap in your trace you don't give a shit about.
In general, IMO the biggest advantage of PowerShell compared to scripting languages like Python/Perl is the ability to natively interact with Windows' COM stuff. That advantage is nonexistent on *nix.
- smackeyacky 5y agoAnd even the com integration is poor. Trying to script anything to do with Outlook is so failure prone and unreliable it turned me off powershell altogether.
- vladvasiliu 5y agoI've actually installed Powershell on my Linux PC last year. I daily drive a Linux box, but I sometimes have to interact with my employer's MS ecosystem (that's technically not my job, so running Linux is fine most of the time). After waiting for the installation to do god knows what for what felt like ever (and I was running an 8 core Xeon with a fast NVMe drive at the time...) I attempted to connect to the Office 365 tenant to do something. Since it was my first attempt at running this on Linux, I was following along with the MS docs (actual docs.ms, not the TechNet circus) and I started getting uncomfortable with statements along the lines of "this should work". I mean, if you're not sure, who can be? Anyway, it managed to install whatever libraries it wanted, so I was ready to go. But everything ended abruptly with some "incorrect credentials" or similar. The credentials were, of course, OK (they worked fine in the web-based admin console). But after some digging, it turned out that, contrary to what the MS docs said, you can't connect to Office365 from linux...
- renox 5y agoI agree that 'set -x' is the shell superpower, as it shows your scripts behaviour but not the inside of the tools you call. I'm quite sad that gdb doesn't have something similar: 'step in my application only' no I don't want to step into the STL shared pointer dereference implementation for the n-th time!