• a lil bee 🐝@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    3 months ago

    Not hating, but you should really try it out before forming an opinion. PowerShell Core is multi platform and if you value readable scripts at all, PowerShell is heads and shoulders over bash. I know all of us admins are proud of our bash scripts, but bash reads like hieroglyphics to anyone who didn’t write it. PowerShell has noun verb syntax and just heaps of syntax sugar. Scripts, even more than code imo, needs that readability for fast debugging and maintenance.

    But hey, opinions on languages and such are highly, highly subjective. No skin off my nose if you just don’t like it at all.

    • Rogue@feddit.uk
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      You’re completely right. The deeper I get into bash the more absurd it is. Trying to iterate through text delimited by line breaks is ridiculously complex. And the sheer number of options for find and replace style operations is confusing sed, awk, printf, why?!

      • a lil bee 🐝@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        Oh and that’s somewhere where PowerShell really shines! Check out the examples on the docs page for some examples and see how easy they are to read and write compared to sed/awk/etc.

        I also think PowerShell being object-based instead of string-based gives it flexibility for those of us who have experience with object-oriented programming languages. Being able to ship around objects to functions, splatting, etc are huge value adds for me personally.

        Again though, sooooo subjective! Some people will legit hate that it’s object-based and hate the syntax. The world supports all kinds of developers and we’re all making cool stuff, so it’s all good!

    • abhibeckert@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      3 months ago

      PowerShell is heads and shoulders over bash

      Sure… but that’s a low bar. Bash is basically the worst shell of them all (if you exclude the ones that are so bad nobody uses them).

      I’m a fan of fish personally. It’s both concise and feature rich. The fish language isn’t something I’d want to write a complex shell script in, but it’s a thousand times better than bash and if you’re writing something complex then I’d argue any scripting language is the wrong tool for the job. Including Power Shell. You should be using a proper programming language (such as C#).

      PowerShell is innovative, for sure. But string output/input shells scripting wasn’t broken (unless you use bash) and I’m convinced trying to fix it by replacing simple string input/output with objects was a mistake.

      I love OOP. However I also love using existing tools that work well, and none of those tools are designed to be OOP.

      • a lil bee 🐝@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        You’re right that Bash is among the worst options available, but it is common and what our friend above indicated he had experience with. I think your points are all valid, but I also find that most professional situations don’t offer much choice in the matter anyway. I used PowerShell because it was my company’s standard and there were 10 years of technical debt built around it. I got to know its ins and outs because of that and find some of them neat.

        I don’t think anyone should take any of my messages as saying PowerShell is best in class for any particular use cases, but I do enjoy using it. I’m all Python and Golang now anyway 🙃