Anyone use powershell on linux?
Anyone use powershell on linux?
Or any other alternate shells that aren't bash?
Anyone use powershell on linux?
Or any other alternate shells that aren't bash?
I've used powershell in previous jobs and if you learn it really well I cannot deny it is super powerful.
For a college project, a friend of mine somehow made a hexadecimal file dumper with it, with formatting and everything (think like what you would see in wireshark) in one, reasonably long, line of powershell.
However I'm just not a big fan of it personally for syntactical reasons (even with the syntax being super logical) and much prefer bash, or other unix-like native shells. I've been thinking about taking zsh
for a spin recently to see what it's like.
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.
At work I use powershell to ssh into Linux boxes fairly regularly.
I use fish
Not that kind of "use!"
I use both fish and zsh
somehow
That's... a big gap. I think I'd just be confused all the time if I had to switch between them.
I mean, missing commands say that it's zsh but everything else says that it's fish.
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.
Honest question: why?
Because, as someone who dislikes MS as much as possible, Powershell is one of the few things they done right :) And when you manage mostly Windows servers and a few Linux servers, why not choose a solution that works on both platforms? And yes, perl, python, ruby, they all work on Windows too, but its just not comparable to powershell on Windows.
So i can understand why someone asks this question :)
Personally, i keep them both seperated, powershell on Windows, bash on Linux. But i can understand why someone might choose to go “powershell all the way” :)
Powershell is a better language but is absolutely dogshit for interactive use IME. It's SO wordy and the excessive use of camelCase is annoying and I yearn for simple GNU coreutils every time I touch it. Like, give me tail -f
please, why does cat
also have a -Wait
option or whatever the fuck
Understandable sentiments. I’m a MS Edge user, for instance, and despite slowly switching almost all my other services, MS Edge just gets it all right. Brave’s featureset is basically a lesser version, and Firefox is getting better, but Microsoft (of all companies) genuinely made a great browser.
Why not? It seems like a well supported shell on windows that isn't terrible.
It seems like a well supported shell on windows
But you aren't using Windows. You're also now adding a .NET Core requirement for any Linux box wanting to use it. That means limited functionality as its not the full blown .NET framework. So, compared to something like bash, you now have added requirements with less functionality.
To answer your original question though, a lot of people prefer zsh as its got a crazy amount of customization you can do. People also like fish due to it being very friendly and interactive.
bash is also well supported in Windows via WSL
Because I have to admin Windows boxes and M365. There are PS modules for lots of different MS things.
I didn't know you could use it on Linux. I'd consider it because I've used it at work for years and my experience with bash is far more limited. Powershell is pretty damn intuitive. I've gotten a lot further with it than I have any other scripting language.
exchange online shell
I used to use fish but I'm learning Unix right now and am trying to use only defaults so I can learn freebsd the way it exists on a dvd, so right now I've been using the Bourne shell
If you are using FreeBSD, you are probably using the Almquist Shell.
https://en.m.wikipedia.org/wiki/Almquist_shell
BSD has not used Bourne since the 90’s. Bash is of course the “Bourne Again Shell”.
For Linux fans, “dash” is the (Debian Almquist Shell). It is the Linux version of the BSD shell. Dash is the default /usr/bin/sh in Debian and Ubuntu I think. So, pretty close to the same shell as FreeBSD.
That's the one!
SO much of the documentation I've seen refers to the Bourne shell I just assumed thats what I was using!
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.
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
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:
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. —format=json
or whatever. 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:
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
cat
andls
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.
yeah overall bandwidth was probably a consideration
Finally! Nushell is awesome. The infrequent deprecations are a bit annoying, but I prefer them to having a bad program go 1.0
Hi! I'm interested in trying Nushell at some point, although I keep putting it off...
Would you share your experience on a couple of items?
grep
or awk
?sure!
bash
commands in because &&
isn’t supported, multiline strings don’t require the \
character, and string escaping is totally different. those are intentional deviations that i personally agree with, but they take some getting used to. and then obviously stuff that is specific to nushell
like working with tables.k8s connect (helm stage dev.0)
which reads my YAML config and connects to the cluster specified in that file. or making a call to our internal package store to get the latest version by parsing the returned JSON. PATH
(or Path
if you’re nasty). you can just drop into it and it will have all the path stuff inherited just like if you launched zsh or bash. you’ll have to set that up if you want to use it as a system shell—like i do—, but otherwise it’s pretty seemless.you can check out my collection of scripts here: https://github.com/covercash2/dotfiles/tree/main/nuenv
ETA: if you do have compatibility problems or need your old muscle memory to do something quick, it’s easy enough to use bash -c old_script.sh
or just drop into a different shell
only for extraordinarily cursed situations where games need it in wine/proton
Basically no one is using powershell on Linux. zsh is popular and i'm using fish.
zsh and oh-my-zsh :)
Same here, just started a few days ago with both and Atuin for history across devices (server can be selfhosted easily)
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.
What's wrong with bash? Something missing or not to your liking? It can be configured
Maybe it can, but with fish, it does what I want right out of the box, and I don't have to spend time configuring it.
It has atrocious error handling, and there's no reasons why arrays should only be 1D.
only when dealing with azure for work. otherwise bash/python work just fine and have for me for the last 30 odd years.
No.
I usually just use Bash; there’s a certain level of complexity where it begins to be more reasonable to just use Python.
I use Linux to get away from PowerShell 😂 I did try zsh though, it was nice, maybe give it a shot.
I use fish, but only interactively. Scripts are either in bash or Python depending om what I need.
I use fish, I had to learn some new syntax and modify some functions since it's not POSIX-compliant, but it was pretty painless.
I tried to use it for admin in a Windows environment, but half the modules I needed wouldn't work in Linux which made it pretty much useless.
Does zsh count?
I use fish, mostly because it is the default on CachyOS
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
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?
I didn't know powershell was an option on Linux.
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.
Nope, I've tried it before but I prefer the muscle memory of bash/zsh.
I'll use it on Windows though.
Fish is the cachyos default, I used oh my zsh too, I honestly cant tell a difference as a non dev end user
I tried fish before switching to zsh because it has much better compatibility with bash, and I think bash/zsh handles a lot of things like aliases way better. I'm also on CachyOS and the default zsh config with ohmyzsh and powerline10k it comes with is great.
I like autocompetion/suggestions
I use xonsh.
It's not my default shell on most of my servers but I use it all the time. I'm just not a fan of treating everything as a stream of text to grep, trim and sort into structured data that's easier to work with. Plus, cross platform. I've tried nushell a bit but I always go back to PowerShell.
I do, but only for work. There are certain tasks you can't do easily with just api calls.
I have used powershell on windows and Linux and I really like that the data that is moved through a pipe is encapsulated in objects. But in the end I stuck with zsh.
I think you have a surplus apostrophe somewhere... 😏
My producer and I personally use Bash. We tried zsh, but that didn't treat us very well. Fish is actually pretty nice, though.
I dont use powershell.
I use ZSH on My Gaming PC cause its POSIX and and has autocorrect and auto complete also with CachyOS They replicate fish features.
I use the Default good'ol bash on my Laptop running Debian that's on Life support because I dont care.
I tried Fish but didnt like the no POSIX compliance(ik they wanna fix POSIX but its annoying)
I use zsh on my work computers and fish on my desktop. Zsh is still POSIX compatible so is more bash-like. Fish is nice. When I use bash or zsh I want to use oh-my-zsh but with fish I haven't found myself wanting anything extra like that.
i just wish bash had structured data and basic types, that's it
I use powershell for some scripting. I've been using .net/powershell forever and I know it better than python. If bash can't handle it in a few lines, and I don't have to use python, I'll go powershell.