1. 31
  1.  

  2. 13

    Well this is interesting. I know PowerShell gets a lot of hate, but most of that hate was really some version of “it’s not bash” or “the default Windows console system stinks”. Thing is, most of the things that aren’t bash are things I really like (e.g., proper object pipelines, parallel execution frameworks as part of the shell, etc.), and I’ve got xterm and iTerm if I’m on Linux and OS X. This, combined with .NET Core, could make a really excellent everyday shell environment for me.

    1. 3

      Regarding PS parallelism: after trying to use it at my day job, my take is it’s great in theory but really painful to use in practice. start-job and friends execute in a clean powershell instance, not a fork (welcome to Windows) so you can’t use functions from outer scope. In a build system utilizing powershell functions, this isn’t okay. Workflows supposedly fix this, but workflows only work in 64-bit ps and our build system only works in 32-bit.

      Both of these are higher in mental overhead than “make &” though, which I think is the main problem.

    2. 6

      And now I wait patiently for an OpenBSD port.

      1. 3

        Based on the build instructions for Linux and OS X, it looks like the first step to porting PowerShell to OpenBSD is to port PowerShell to OpenBSD.

        Or maybe that’s the second step, after fixing all the /usr/bin/env bashes in the build scripts.

        1. 2

          Off-topic, but what’s wrong with /usr/bin/env bash? My team often writes /bin/bash for scripts and I’ve been changing it to /usr/bin/env bash for my NixOS.

          1. 6

            env: bash: No such file or directory

            :-)

            Many scripts with a bash shebang don’t really need bash and would work with any posix-ish shell. If they used /bin/sh instead it would be one less hassle for porters.

            1. 0

              Because bash isn’t always in /bin. /usr/bin/env will find the bash in the PATH, and as long as your PATH is set up right, the right one.

        2. 4

          Wow! Microsoft has come a long way since the days of Ballmer and Linux is a cancer. Free software really has won.

          That said, I haven’t used PowerShell much but the few times I’ve used it I didn’t really like it. The length of some command lines to do basic stuff like setting up a domain controller on Windows Server Core were horrendous.

          1. 3

            I think the idea is to use aliases alot, but have a standard way of writting command names.

            1. 2

              Ah, makes sense. Seems not all of the aliases are a good idea though (lobste.rs discussion).

            2. 2

              What superpat said, plus: tab completion for cmdlets/functions/executables and parameters..This is one of my favorite things about powershell. I never have to remember crap like what the argument names are or what the order is, almost never have to “foo –help”, and I don’t have to type most of it, because I can use tab completion on cmdlet parameters.

            3. 4

              Good news from where I sit. Object pipelines are super cool. “Everything is a stream of bytes” is a crazy powerful concept, but evolution is good too.

              1. 2

                @Irene suggest this be merged into other story.

                1. 2

                  I’m officially intrigued. Also, adding ssh transport will make running Windows at home a much more interesting proposition.

                  1. 2

                    the powershell people are porting openssh to windows: https://github.com/PowerShell/Win32-OpenSSH/

                    i tried it out a while ago, and it worked (i had problems with https://github.com/PowerShell/Win32-OpenSSH/issues/227 but that is fixed now i think). it feels kind of strange to use ssh and get a powershell prompt :)

                  2. 2

                    I’m not really sure how I feel about this.

                    The best part of PowerShell on Windows (I had to admin some Windows boxes once, but I keep that off my resume) is that you can call into libraries that expose .NET bindings. A PowerShell that doesn’t offer this seems pretty lackluster. Honestly, since Linux doesn’t own their ecosystem, it’d be really difficult to get anything remotely close to PowerShell there.

                    That said, any of the BSDs could probably do it if their developers were so inclined. That would be an environment that I’d really want to use.

                    1. 2

                      https://github.com/PowerShell/PowerShell/blob/master/license_thirdparty_proprietary.txt

                      It seems not everything is available as free software, there is some stuff about Microsoft .NET license etc. Use carefully :)

                      1. 1

                        I thought .NET was now owned and controlled by a foundation that provides it under a permissive license? Perhaps there is still a part that is specific to Windows that isn’t? Perhaps I don’t really know what .NET is–it was always kind of amorphous.