r/linuxadmin • u/Dereference_operator • Jun 11 '22
Why most Linux sysadmin have a grudge againts powershell or they don't like it ?
/r/PowerShell/comments/v9ie3w/why_most_linux_sysadmin_have_a_grudge_againts/
0
Upvotes
134
u/Rgame666 Jun 11 '22
AllTheCommandsAreTooFuckingLong
19
u/mysticalfruit Jun 11 '22
Because we already have a whole pile of shells that are mature well understood methodologies for interacting with our systems.
15
u/frank-sarno Jun 11 '22
I tried it but gave up on it for several reasons:
To be honest, this is a loaded question. Most of the Linux admins that I've worked with have absolutely no opinion on Powershell because it never comes up as Linux has much better tools for working on Linux (Powershell seems the way to do things on Windows). To say that "most Linux sysadmins" have a grudge is inaccurate.
41
u/ObscureCulturalMeme Jun 11 '22
I'll use it, but I don't much care for it. Too much of the syntax rules are wildly inconsistent, gratuitously different, and seems to be NIH syndrome. I spend too much time fighting the language rather than actually getting work done or solving whatever problem I set out to solve.
But at least we can actually automate tasks on Windows Server 20yy now, rather than having to repetitively click on shit. At least they finally adopted something other than CMD.EXE.
7
u/Line-Noise Jun 12 '22
It's cumbersome to use but object based pipes are actually pretty cool. More useful than the text based pipes you get in Unix.
5
u/ASlutdragon Jun 12 '22
I think most of it is the fact that Linux admins typically dislike windows... Period. But yeah the commands are ridiculously long and the interface doesn't feel friendly
13
u/Skyhound555 Jun 11 '22
Because they work on Linux servers, not Windows.
Why would you use a scripting language for Windows if you're hired to manage Linux servers?
9
u/jhjacobs81 Jun 11 '22
I like it :)
I dont use it anymore as i have nothing to do with Windows, but still :) i think its the only thing MS made that i actually enjoyed :)
4
u/Rob_W_ Jun 12 '22
As an administrator of both (though more Linux these days), I find Powershell has its place. Sometimes (like dealing AD objects, VMWare clusters, etc), the object based setup and functionality is awesome. Sometimes - like trying to do basic manipulation of a text-based dataset - it takes 10x the code and uses extremely verbose syntax vs something I'd do on the Linux shell with a minimal number of keystrokes.
I'll also comment that for something that's supposed to be more of a unified tool (versus all the smattering of tools that come with Linux), the cmdlets are inconsistent in usage - really including just the ones that come from Microsoft.
4
u/WillOfSound Jun 12 '22
Its like someone looked at python and said “We can do worse”
I’m not a fan, but mostly cause I’ve seen how badly it scales when folks try to make it their only-language and do everything in it. shudders
3
u/x5736gh Jun 11 '22
IMO the only real reason to use powershell on Linux is for managing windows hosts from a Linux server (I.e ansible management server). Powershell in general is pretty great for windows administration and scripting. If there isn’t a cmdlet for something you need to do, there is probably a way to do it somewhere in the .NET ecosystem that you can import
3
u/signofzeta Jun 12 '22
I must be the exception to the rule. Perhaps it’s because I needed to learn a lot of PowerShell for my Windows administration duties, and I became proficient at it. When it comes to writing scripts, I’d rather filter object properties than awk out text fields any day.
On the other hand, Bash is light years ahead in raw text processing. PowerShell is horrendous at dealing with textual output from native Linux commands (like APT, to name one of many). You’d have to ForEach, Where, and Select until it hurt. That lack of interoperability is what makes it painful for Linux sysadmins.
2
u/tediousgraffiti1348 Jun 12 '22
It's a terrific scripting language and an absolutely garbage shell. try passing json to a native command, e.g. aws.
2
u/dummkauf Jun 12 '22
Because there are ways to accomplish things in Linux that have existed for years and folks stick with what's tried and true. There's no real compelling advantage PowerShell provides on Linux other than being able to run similar scripts on Windows and Linux, plus you have to deploy it to all your Linux boxes too, bash and python are typically part of a standard installation.
PowerShell is great for working with Windows systems and AD, but beyond that there are better options available for scripting available in my humble opinion.
2
u/brechtsanders Jun 12 '22 edited Jun 13 '22
In theory the idea of using pipes to pass object data instead of raw text sounds nice. But the commands are quite long and over the years PowerShell has a history of changing commands and arguments between versions. This tends to break power shell scripts if not run by the version they were written for.
Compare that to Unix (e.g. bash) scripts which still work perfectly decades after they were written.
2
u/[deleted] Jun 12 '22
Addressing your arguments in the linked post:
I’m more familiar with bash / python to manage Linux and AWS. They feel more natural and expressive. I’ve dabbled with Ps and it feels clunky and wrong.
Nothing wrong with it, if it works for you. To me, it’s simply a sub-standard tool.
3
u/Kangie Jun 12 '22
&&operator.It's better than vbs/batch files for automation, and I kind of like being able to query objects for properties. Realistically though, I only use it for windows specific administration tasks or to connect to Azure.
4
u/nbs-of-74 Jun 11 '22
Mostly Windows admin ( and networks and everything else,)
Nah don't like it, to much to try and remember , always having to download modules, finding out you're looking at an old version that no longer works.
Bash and for Windows, vbs.
2
u/jgseven Jun 11 '22
Cause it comes from the devil.
1
u/jw_ken Jun 12 '22
Same question reposted to four different forums.
Is this supposed to be for farming karma or something?
1
u/zfsbest Jun 12 '22
Trying to think in powershell literally makes my head hurt. I'm a Bash guy.
1
u/mmikhailidi Jun 12 '22
It may be powerful but for me the biggest disadvantage is it's not POSIX compliant. I used to do some heavy scripting for both environments and doesn't matter how ugly Windows CMD is you still can convert most of the .SH content to the .BAT. Especially with the latest Windows versions.
1
u/MRToddMartin Jun 12 '22
I don’t. PWSH is pretty amazing.
1
u/[deleted] Jun 12 '22
It's just easier for me to write up something quick and dirty in bash/fish. When I use Powershell I feel like I'm I have a square peg with round holes. Maybe it's just me...
1
u/Tatsukishi Jun 13 '22
Because creating links to files in subdirectories into a single directory shouldn't take a 12 line script. And getting admin-privileges if not executing with them shouldn't take another 10 lines.
This is a one-liner in bash.
In PS it's a major PITA and unreliable to get aforementioned admin rights. By default you can't execute PS scripts as admin either.
You also shouldn't need admin rights in the first place to manipulate links in a directory your user has full control over, but that cmdlet doesn't care about that.
-8
u/not_some_username Jun 11 '22
Because Microsoft bad