4 ms·
Or just use powershell. It has some idiosyncrasies but its a pretty nice platform for scripting
by JamesSwift 1y ago
Or just use powershell. It has some idiosyncrasies but its a pretty nice platform for scripting
- moomin 1y agoHere’s the really annoying thing with powershell: it doesn’t have a module distribution model. Like, at all. A csharp script, on the other hand, gets NuGet out of the box.
- accoil 1y agoWhat is the PowerShellGet module[1] missing? It comes preinstalled in all versions post 5.1 (though 5.1 itself is limited). [1]: https://learn.microsoft.com/en-us/powershell/module/powershellget https://learn.microsoft.com/en-us/powershell/module/powershe...
- moomin 1y agoTFW where you're dead wrong and have to upvote everyone who told you so...
- pjmlp 1y agoNot only it has modules, there are several NuGet like repos for Powershell.
- Natfan 1y agoFalse: https://www.powershellgallery.com/ https://www.powershellgallery.com/
- shagmin 1y agoEspecially for C# developers. You can use any CLR (e.g. C#) objects in powershell, for prototyping, automation, proof of concept, etc.,.
- noodletheworld 1y agoIt is reasonably unlikely that bash scripts are easily replaceable by powershell scripts. Theres a fair argument that complex scripts require a complex scripting language, but you have to have a good reason to pick powershell. Typically, on non-windows, there is not one. Its the same “tier” as bash; the thing you use because its there and then reach past for hard things. The same reason as bash. Theres no realistic situation I would (and Ive written a lot of powershell) go, “gee, this bash script/makefile is too big and complex, lets rewrite it in powershell!”
- kbolino 1y agoTo this day, error handling in most Unix shells just sucks. Background commands, pipes, command substitutions, functions, if/while conditions, subshells, etc. are all "special cases" when errors are involved. You can make them suck less but the more you try to handle all the possible ways things can fail, the vastly more complex your code becomes, which the Bourne lineage languages just aren't ergonomically suitable for. I think PowerShell was totally right to call this out and do it better, even though I don't particularly love the try-catch style of exception handling. False is not an error condition, exceptions are typed, exceptions have messages, etc. The problem with PowerShell coming from bash etc. is that the authors took one look at Unix shells and ran away screaming. So features that were in the Bourne shell since the late 1970s are missing and the syntax is drastically different for anything non-trivial. Other problems like treating everything as UTF-16 and otherwise mishandling non-PowerShell commands have gotten better though.