The PowerShell-Haters Handbook

(telcontar.net)

13 points | by Mr_Minderbinder 2 days ago ago

7 comments

  • perarneng a day ago

    I was forced to use Windows Server for an assignment and I like to learn new languages and PowerShell seemed interesting even though it's really ugly. It's much nicer to work with than Bash since everything is an object instead of having to do complex string magic. I can really recommend people trying it at least. Nushell is similar and probably what you would go for on linux, just played with it a bit and I liked it as well.

    • steve1977 a day ago

      Not only that, it's also typed.

      So if you iterate over files for example, you can get the modification date as an actual DateTime property and not some string that might contain a date in some locale that you potentially have to parse then.

      • SoleilAbsolu a day ago

        Also - regarding linked article's statement "PowerShell joins MSI files as another type that cannot be run as an administrator" - I have always just started a PowerShell/Terminal app as administrator which has more or less the same effect, though of course everything in that session is run with elevated permissions.

        • steve1977 12 hours ago

          I don't even fully understand what the article means with that regarding MSI.

          Windows Installer will elevate automatically (i.e. prompt with UAC if needed) if you're administrator. Or you as you say you open a command prompt as administrator and run the MSI with msiexec.

  • gabrielsroka a day ago

    2020

    > PowerShell scripts require all subroutines to be defined before they can be called

    True but so do Python and other languages. My solution is to put main at the top and then the very last line of the file calls main.

    > "New" as a verb

    Look in your File menu.

    > PowerShell ISE

    Was put in maintenance mode in 2017, 3 years before this article was written. Granted it still comes bundled in Windows. It actually has some great features, but also many quirks. New work is done in Visual Studio Code.

    Many of the rants could be made against other languages. I admit PowerShell is not perfect, but there are some really cool things about it.

    Bjarne Stroustrup, the creator of C++, is famous for the quote: "There are only two kinds of languages: the ones people complain about and the ones nobody uses".

    • techbrovanguard 13 hours ago

      This is not the gotcha you think it is. Nobody that has used C++ in a non-trivial setting would regurgitate that Stroustrup quote unironically. C++, much like Powershell, is a warcrime of a language.

      I'll give it up to Powershell though, it actually had some good ideas... albeit with awful execution. Can't say the same about C++.

  • 7bit a day ago

    PowerShell is really great to work with as a shell, compared to bash, where everything is just string you have to awkwardly parse with commands that nobody ever remembers.

    Love PowerShell!