I can't believe PowerShell is good

(spacebar.news)

16 points | by corbindavenport 1 hour ago

4 comments

  • xp84 0 minutes ago
    I have to admit it's better than scripting in Bash, but in my personal opinion that's a bar so low it's on the ground. Don't get me wrong, I'm grateful that shell scripting is a thing. But my policy for a decade has been that when I need any logic more complex than a simple string matching in an `if`, I should back away from the computer and then rewrite it in a reasonable scripting language.

    Powershell is definitely a reasonable scripting language; it's mainly its verbose command names and new-to-me syntax that have made me put off learning it so far. I suspect that it looks more familiar and welcoming to .NET devs though.

  • 3eb7988a1663 6 minutes ago
    I have only ever used Powershell when I had no other options, but a decent number of the APIs feel designed by someone who has never used a terminal. Like they were begrudgingly fulfilling the objective without ever imagining a real use-case.

    Naturally, I cannot produce an example off hand, but I was pretty disappointed the last time I had to reach for it and found that a few "obvious" workflows seemed more hacky than I would have expected for a clean-slate terminal language design.

  • SBArbeit 4 minutes ago
    Part of setting up a new Windows or Linux machine for me is installing the latest PowerShell 7+.

    My $PROFILE has custom modules that comprise ~9,000 lines of PowerShell. Anything "script-y" that I think I'll do more than a few times becomes a new function in one of those modules.

    On Windows, I haven't used `cmd.exe` in at least a decade.

    And part of my root `AGENTS.md` is "Please use PowerShell when generating scripts, unless I specifically ask for a different language."

    Works a treat.

    Once you get used to passing objects between commands - not just text - the thought of using a Unix-y shell feels like visiting the past.

  • ruined 9 minutes ago
    unlike macos's curl, powershell's curl alias for Invoke-WebRequest checks the revoke list and will protect you from mitmproxy --emudhra
    • Superbowl5889 6 minutes ago
      Why doesn't curl check revoke list.
      • ruined 4 minutes ago
        i don't know, man. i don't know.