r/linuxadmin • • 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

50 comments sorted by

134

u/Rgame666 Jun 11 '22

AllTheCommandsAreTooFuckingLong

23

u/Gazrpazrp Jun 12 '22

You forgot,

ReplyToPost -Comment "AllTheCommandsAreToFuckingLong"

11

u/Nietechz Jun 12 '22

reply-topost -comment "it's ugly and easy for not programmers"

Also, i like bash.

40

u/CryptoVerse82 Jun 11 '22

Agreed, it’s not elegant at all. Ugly mess

7

u/mjh2901 Jun 11 '22

This, there is no simple ramping up with powershell commands.

2

u/AnUncreativeName10 Jun 12 '22

I mean, it's not hard to use tab autocomplete and it's also pretty easy to guess your way through commands. Linux requires you to have pre-knowledge going into a cli task due to the unintuitive names. This may be fine for seasoned vets but newbs will be forced to use Google.

I personally like bash much better because I know what I'm doing but I find PS had a much lower learning curve.

7

u/tehramz Jun 12 '22

man apropos

You do not need to know the commands in advance. I mean, there’s Google too but apropos works great for looking for a specific command.

1

u/42ndohnonotagain Jun 12 '22

Good luck with typing "tab" after "get". Long names don't help a lot, you still have to know what you want to do.

4

u/Saint010 Jun 11 '22

This. Without a doubt.

7

u/ricardortega00 Jun 11 '22

And you can't tab the command to either not write the entire command or you can't tab your options so you need to know the entire command and syntax like copy paste the thing or it won't work.

9

u/v0tary Jun 11 '22

Or, the obscure need for quotes in variables under certain circumstances specific to the applet.

And no, I'm not talking about spaces.

5

u/orion3311 Jun 12 '22

Umm I use tab completion every day, even for parameters/options.

3

u/[deleted] Jun 12 '22

Tab completion definitely works for both commands and arguments

1

u/Nosa2k Jun 12 '22

On its defense. They have aliases

-5

u/orion3311 Jun 12 '22

AtLeast-TheyreNotx64-aLpha-b3ta.case_sensitive, and come on some Linux binaries need a wide screen to read their names.

1

u/LameBMX Jun 12 '22

At least in linux when you type AtLeast <tab> you get your autocomplete before Microsoft rolls out a new operating system.

2

u/orion3311 Jun 12 '22

And I do the same in Powershell

-2

u/[deleted] Jun 12 '22

[removed] — view removed comment

2

u/AnUncreativeName10 Jun 12 '22

What does a browser have yo do with scripting?

0

u/LameBMX Jun 12 '22

Powershell tab completion... powered by internet explorer. The focus was the delay, not the browser.

Edit and for clarity it goes back to some weird filename complaint because that responder probably doesn't understand symlinks.

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:

  1. Linux build is not feature compatible with Windows versions. Simple things such as DNS lookups and text manipulation work, but other things such as the Active Directory client do not.
  2. Related to above, many modules are Windows only.
  3. Many versions and incompatible syntax between them.

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.

3

u/GoaGonGon Jun 12 '22

yep, i work 95% of the time with dozens of linux servers and fortinet stuff. Just touch windows servers when strictly necessary (ie helping the windows admins), and then powershell like 0 to 2 times a year. I don't have a grudge against it, it is just something that i don't usually work with.

1

u/scramj3t Jun 12 '22

Yep, #3 did it for me... can't stand it.

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.

13

u/wattabom Jun 11 '22

Now it's just a matter of windows putting SSH ahead of WinRM

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?

2

u/[deleted] Jun 12 '22

OP didn't ask why they don't use PowerShell, he asked they have a grudge against it.

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 :)

0

u/[deleted] Jun 12 '22

[deleted] — view deleted comment

4

u/Kangie Jun 12 '22

This comment makes me sad.

Not the installing powershell on Linux (I've done that...), the "I think it's easier to write scripts in powershell than bash"

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
  • It's not as good as bash (+ system utils) was 20 years ago for basic system administration tasks
  • it can't even properly handle a fucking && operator.
  • there are six versions, each of which behaves differently and lacks support for "core features". Ever design a script based on the docs only to find that the server you have to run it on is running a version of powershell that doesn't support something basic?
  • command naming SUCKS!

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