3 ms·
How about Powershell https://github.com/PowerShell/PowerShell https://github.com/PowerShell/PowerShell I can't call myself a fan of powershell but if everyone
by asiachick 6y ago
How about Powershell
https://github.com/PowerShell/PowerShell https://github.com/PowerShell/PowerShell
I can't call myself a fan of powershell but if everyone switched I'd get used to it.
sh and bash both seem like they should die in a fire. They are full of foot guns that end up costing millions in breaches and lost data. The space think even bit Apple back in the day, they had some OS upgrade script that ended up deleting your entire hard drive if there was a space in the volume name.
- Kuinox 6y agoPowershell is a bit better, but got it's own disadvantage: Despite the consistent naming, I can't remember correctly the modules names. Running Remove-NetFireWallRule without arguments delete all the firewalls rules despite a flag "-All" not being set. The learning curve is too hard, or it's too complex to learn on the job: It takes me at least half an hour to write semi-complex commands despite the number of hours I struggled trying to write commands with. And it still suck as a scripting language.
- sedatk 6y ago> And it still suck as a scripting language. Why do you think that? I find PowerShell quite neat and more consistent than what bash and alike has to offer.
- Kuinox 6y agoIt does "resume on error" by default. It got script languages issues: The last line of your huge script may be syntaxically invalid. Here you start thinking "why I didn't wrote it in my favorite statically compiled language" Yes, it's still more consistent than what bash and alike has to offer, but it's still behind if you compare it to any language that you can write to a file. The only advantage it got against them, it's the huge API on windows. Sadly I wanted to use Powershell functions from C#, tought it would be easy because Powershell use .NET Core, but it's far from easy.
- boston_sre87 6y agoI usually avoid scripting in bash or sh and use python instead on the linux side. But yea, powershell is a pretty solid shell and seems more intuitive than bash/sh. The object oriented part is pretty awesome and lets you introspect objects easily so you know what kind of properties and methods are available.
- ZeteticElench 6y agoPowerShell is pretty damn awesome once you get the hang of it. The way objects are passed via pipe allows for really cool things like get-foo | where {$_.bar -eq 1} and you can serialize the output of most commands with get-foo | convertto-json. I use this feature all the time. Get-ADObject | convertto-json will give you a dump of your entire AD.
- chubot 6y agosh and bash both seem like they should die in a fire. They are full of foot gun Right, that is the point of Oil. The post describes 4 footguns that you can now avoid. Moreoever, you can run your existing shell scripts with Oil first, and gradually move away from the dangerous style. Rewriting even 500 lines of shell in Python is not a pleasant task (even if you think Python is better for the task).