4 ms·
I think there's power in the idea of structured objects in a shell, but is there a community that actually feels that PowerShell is a productive language? I'm b
by surfmike 5y ago
I think there's power in the idea of structured objects in a shell, but is there a community that actually feels that PowerShell is a productive language? I'm biased coming from a Unix/bash background, but the times I've tried to get into PowerShell it's been quite clunky to use.
- jabroni_salad 5y agowindows sysadmins like it, I guess. I serve mid-size banks and everyone is running mainframe and windows server. I use powershell + .net operationally in the same way a linux guy would use bash + python. I know HN is a cloud-first developer community but there is an entire planet of businesses who are software consumers rather than software development firms. Windows is running /a lot/ of stuff even if you personally are not seeing it. I know a lot of people don't like how verbose cmdlets are, but I find tab completing them to be just as fast and easier to remember than linux's alphabet of case sensitive switches that barely represent the underlying function. Oh, and keep in mind that we evolved to this from .vbs, which was horrible.
- larodi 5y agoit is absolutely useful, and starting as someone coming from Perl background and lots of it, PowerShell indeed is more than just a shell scripting. Sitting on top of .NET opens up to lots of functionality and on the automation front - POSH programs are much easier to read and maintain than bash/ksh/whateversh. So yes - it is very useful, and there is great community on both sides on the ocean (USA and Russia) that make heavy use of it.
- criddell 5y agoPowershell is better than batch (.bat or .cmd) files. I remember when I was new to shell scripts, thing like basic if loops felt clunky. I would see something like "if [ -r $1 ] && [ -s $1 ]" and not even now where to start. Case statements I could only write by taking an existing one and modifying it. These days I tend to use Python for all my scripting everywhere I can.
- AnIdiotOnTheNet 5y agoShort answer: yes. I will take PowerShell over bash/unix with its numerous antiquated footguns and coreutils' horrifically inconsistent and unreadable switches and clumsy text parsing any day. Even within the unix community there are efforts like Elvish and NuShell trying to be more like PowerShell because it's obviously better.
- 0des 5y ago.. Is this real life?
- tonyedgecombe 5y agoI think it's one of those languages that you need to be immersed in to really benefit from. If you only use it occasionally then you will never internalize it enough to become proficient. Most Microsoft sysadmins will be living and breathing it.
- pie_flavor 5y agoI have no idea about a community, but it does what I need quickly, and it does it the first time, instead of after ten extra minutes fiddling with awk/cut/sed. It clunks against Bash instincts, because it wasn't designed to be like Bash, because Bash wasn't designed to be like how programs actually operate.
- yumaikas 5y agoFor 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 that one gets with bash, in most cases. 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 https://github.com/yumaikas/psi.