Or any other alternate shells that aren’t bash?

  • lordnikon@lemmy.world
    link
    fedilink
    English
    arrow-up
    59
    arrow-down
    3
    ·
    3 months ago

    The idea of someone using powershell when you are on Linux is a form of self harm and you need to reach out as its clearly a cry for help.

    • Euphoma@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      13
      arrow-down
      2
      ·
      3 months ago

      Why not? It seems like a well supported shell on windows that isn’t terrible.

    • jollyrogue@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      3 months ago

      Because I have to admin Windows boxes and M365. There are PS modules for lots of different MS things.

    • signofzeta@lemmygrad.ml
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 months ago

      Because I never learned Bash scripting, for whatever reason, and WSL wasn’t yet available to load on my work PC at the time.

    • DasFaultier@sh.itjust.works
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      3 months ago

      If you run VMware, you can use PowerCLI to interact with your vSphere servers, and PowerCLI requires PowerShell and uses similar syntax. I haven’t tried it on Linux yet, but I would assume that that might be a valid use case.

        • DasFaultier@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          3 months ago

          It’s been a while for me and i can’t try things out atm, but i think vSphere SSH access is only for managing the appliance itself, not objects like VMs in a vSphere cluster. For that, you would have to use the Python SDK or PowerCLI.

  • chrash0@lemmy.world
    link
    fedilink
    arrow-up
    21
    ·
    3 months ago

    i’m a big nushell fan.

    i was once sitting where you are. when PowerShell was released on Linux i thought about switching and read the manual. i really liked some of the philosophy:

    • descriptive names for commands. cat and ls have canonical short names to save disk space on the systems they were created for. this is no longer a constraint and aliasing a longer command name is better than “git gud n00b” when it comes to discoverability.
    • structured data. “everything is a string” is great when programs play nice. it breaks apart when programs prefer human readable output or worse don’t provide structured output, like format=json or whatever.
    • modern control flow semantics. yes, pipes are great, let’s keep those, but why do i have to rtfm every time i want to bang out a simple script with an if-else control flow?

    i looked around at a few solutions. xonsh uses Python. eshell is integrated into emacs and uses Elisp. i briefly tried to hack something together using Kotlin Script. and yeah, i tried PowerShell.

    i settled on nushell not just because it fulfilled the above requirements, but also:

    • simple data types. string, number, list, record, and table are about the only types you deal with.
    • wide support for structured data. JSON, YAML, TOML, CSV, etc have parsers built in. jq and other such tools are made irrelevant because you just load it into nushell query with a unified DSL using common syntax like select and where.

    honestly, these are the killer features. there are so many more. context aware autocomplete, modules and overlays, super easy custom completions, extension functions (one of my favorites is git remote open), cross platform (if you’re forced to use Windows), plugins, and i can contribute since i do Rust development for work.

    give PowerShell a shot, but i think nushell is the happy medium

    • flying_sheep@lemmy.ml
      link
      fedilink
      arrow-up
      5
      ·
      3 months ago

      Finally! Nushell is awesome. The infrequent deprecations are a bit annoying, but I prefer them to having a bad program go 1.0

    • zarkanian@sh.itjust.works
      link
      fedilink
      arrow-up
      3
      ·
      3 months ago

      cat and ls have canonical short names to save disk space on the systems they were created for.

      I thought it was to save on keystrokes due to slow transmission speeds.

  • beeng@discuss.tchncs.de
    link
    fedilink
    arrow-up
    8
    ·
    3 months ago

    At work we use it sometimes on Linux because we maintain a script that needs to work on multiple platforms, ps1 did that in this usecase better.

    Came down to ps1 on Linux was better and more predictable than bash on windows.

    Sadly.

    • Papamousse@beehaw.org
      link
      fedilink
      arrow-up
      2
      ·
      3 months ago

      Same, only time we used it is when we needed a script that was running in Windows and Linux, easier to maintain one script that 2 in 2 languages

  • the_weez@midwest.social
    link
    fedilink
    arrow-up
    5
    ·
    3 months ago

    Only when I’m doing MS shit for work. Otherwise I find it kind of a pain. I get that some of it’s ideas are nice, but functionally it doesn’t actually do anything for me on unixy systems that bash doesn’t so I don’t. I’m not going to install it on all my servers so using it for scripting doesn’t make sense and I do more Linux admin than MS.

  • eldavi@lemmy.ml
    link
    fedilink
    English
    arrow-up
    5
    ·
    3 months ago

    i ws forced to do it recently and noticed that they enforce usage of black terminal, like it is in the command prompt in windows.

    it was a pain in the ass to keep switch colors just to touch that one powershell module and my first priority to replacing with with a python equivalent. they still think that the powershell module is being used, but it’s no longer capable of working in this environment and they’re going to have to spend $$$ to make it useable because i forsee LOT of difficulty and delays in bringing it up to spec.

  • Heavybell@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    3 months ago

    I use it for some things. It’s good for file batch processing, for example. I could probably do those things in python but I use C# and powershell at work so I know .net better.

  • stiltonfondu@sh.itjust.works
    link
    fedilink
    arrow-up
    3
    ·
    3 months ago

    I use PowerShell on Linux for work stuff. We maintain a set of Azure deployment scripts that were originally developed on PS 4 and 5 for Classic Azure. They’ve been migrated to AzureRM and now PS Core and Az. The scripts are now fully cross-platform.

    We even use some PS remoting over SSH for remotely deploying stuff on Linux VMs where we run some bash commands for configuration.

    I started with bash scripting years ago and never really used PS for Windows or exchange server admin. Just in the last decade for Azure stuff.

    Sounds weird and horrible but it’s fine.

    Bash is still home

  • Tapionpoika@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    3 months ago

    It is not always Bash. Zsh comes as a default with some Arch based distros like Manjaro (xfce) and Garuda, plus Kali of course. But what is the point to use PowerShell in Linux? … Azure, Exchange or Windows servers or something else I don’t get?