T O P

  • By -

peacefinder

It’s a suitability for purpose thing. If Bash worked well for Windows, no one would have bothered to make Powershell. On the other hand, Bash has fifty years of integration work with *nix. Bash and Powershell are ***vastly*** different beasts. Bash is all about streams of text, while Powershell is all about objects. *nix systems are heavily designed around text and doesn’t really have native objects as part of its design. Windows is the opposite. Coming from Bash familiarity, I found Powershell frustrating to work with because I thought it worked like Bash. Once I understood the object nature of the data streams though, it made a lot more sense and I’ve gotten more out of it. But it is definitely an entirely different way of thinking about scripting.


riglic

Exactly this. It's two pair of shoes.


sovnade

Doesn’t win10 support bash fully?


Historical_Issue_562

Even if it did, there is no way to manage systems from bash on Windows. Bash on Windows is isolated in it's own little sandbox.


powerfulbuttblaster

Show me how to run Windows updates on a remote system using bash. Otherwise it's worthless.


sovnade

Wow, sorry i guess our definitions of worthless are wildly different.


powerfulbuttblaster

Worthless when your admining systems. Bash let's you run executables. PowerShell is fairly useless without installing modules. Why can't windows updates be ran via whatever shell I have installed? I can run `apt upgrade` using sh, ash, bash, csh, zsh, ect. PowerShell is a huge framework for writing apps that MUST run within PowerShell. Pretty worthless to me.


floogled

I am in this exact situation. I have worked with bash for years and am very comfortable with it, but have now moved into an MSP role supporting 99% Windows assets. I am having to get proficien5 with PS... do you recommend any particular resources to help me along? I find it frustrating in the exact way you describe, lol.


peacefinder

Don Jones [Toolmaking](https://youtu.be/KprrLkjPq_c) video series on YouTube is what enlightened me. Usually when a dude in a YouTube video says “here’s what you’re doing wrong and why” it’s just BS. But in this case, he directly addressed my fundamental misunderstanding of the platform. Better still addressing that misunderstanding isn’t even the *point* of this series, so there’s a lot more there. I highly recommend it.


floogled

Hey thanks ;) This guy is cool.


kiryo

I wouldn't put it better my self. Nice


Historical_Issue_562

I find Powershell is slower executing scripts compared to Bash. Bash is lean and mean, Powershell fat and bloated.


[deleted]

TIL powershell is on Linux (i'm a noob). Thanks


hayfever76

BTW, it works great on Linux too. Also works great on your Mac.


[deleted]

I write PowerShell exclusively on my Mac. Funny how that’s worked out. Only issue I’ve had is the Azure module not working. Although I haven’t spent much time trying to get it to work


kaiserpathos

I found the OTHER engineer who writes his PS scripts on a Mac! Yes! Seriously though, it really is buttery smooth to develop my scripts on my Mac. I finished my universal $profile recently which works on Azure Cloud Shell, Mac, and Windows PS sessions (Even works on 5.1 Win machines, though I do everything in PS Core these days). Same trouble with certain cloud mgmt modules, Intune as well. MS will get there.


[deleted]

There’s DOZENS of us! 😂


chinpokomon

A dozen and one...


jackinsomniac

As a natural Apple-hater (mostly due to my obtuse, non-technical iPhone-owning friends, who like to only half-jokingly give shit to everybody else about it), I applaud y'all! (And what kind of truly technical person even gives a shit about OS preference anymore?) PowerShell is a pretty decent systems automaton language, eventually, finally. :D


gorramfrakker

Mind sharing said universal $profile script? With any PII removed of course.


kaiserpathos

Sure, here you go -- it's big, but loads quick... [https://goonlinetools.com/snapshot/code/#9xp3kgilwc4d7xkn44k1z8](https://goonlinetools.com/snapshot/code/#9xp3kgilwc4d7xkn44k1z8) I employ a function from [here](https://xkln.net/blog/securely-synchronizing-powershell-profiles-across-multiple-computers/) to safely load my profile from a Secret Gist, so I can load it on any platform quickly. Get-Excuse is my favorite whimsical function. Use it daily lol


HughJohns0n

That is a thing of beauty.


TeamTuck

Well I’m saving this one. As someone who prefers Linux/Bash commands, the aliases you have are genius. Are you not importing modules upon profile loading? I usually import some basic modules although it does slow me down a little. Also, how is compatibility with MacOS and modules like AzureADPreview?


eclectic-thinker

This is brilliant, as an old *NIX scripter thos is a thing of beauty, thank you.


[deleted]

I installed it on macOS specifically for the Azure module


Sin_of_the_Dark

Yeah, unfortunately a lot of the Azure/Exchange modules have yet to be made compatible with PS7


[deleted]

With the exception of a few cmdlets that I almost never use, the exchange module works pretty well :D took a bit to get it working though, because of dependencies I had to manually install


alinroc

Even on Raspberry Pi


iisdmitch

Yup. I use the EXO cmdlets on Mac all the time, works great.


entropic

I never thought to try it.


[deleted]

As a 20 year Unix person and the elected spokesperson of all of us: it’s because we’re REALLY good at scraping text with grep/ sed/awk etc. we don’t understand how hard regexs are for everyone else and don’t like Microsoft because of bad things they did 20 years ago.


BertProesmans

It's funny to me that all replies are about regex in Powershell. Parent's text is a fair description, but the 'problem' isn't explicit. In Powershell you don't need to scrape for the most common cases because all pipe things are objects. 'simply' select the property you need and push it along. Bonus points to powershell because it can (attempt) to correctly convert your pipeline thing into the right shape


NightH4nter

it's not like you can't/won't need regex when you use powershell


OPconfused

You can scrape text with PowerShell and much more. Also, what does RegEx being hard have to do with PowerShell? PowerShell has even more power when you use RegEx. These are the responses I never understand from Linux admins. It basically implies they dont like PowerShell because they dont know how to use it to get more work out of it than Bash. Or if we just ignore the attempt at a technical justification in your comment entirely, then the only thing left is the remark on a blanket bias of loathing for everything Microsoft.


[deleted]

I know you can scrape text with powershell, my comment didn’t imply otherwise - you haven’t really understood my point, maybe that’s my fault for not being clear enough. Unix people view scraping as the way you get meaning out of command line output. Unix people don’t find scraping difficult (which it is) because they’ve been scraping forever so the need for structured output isn’t apparent to Unix people.


OPconfused

I see, sorry for misunderstanding. The part about RegEx seemed to imply that PS users don't understand RegEx like Linux admins which threw me off.


lanerdofchristian

Having also worked with both bash and PowerShell, PowerShell's text-processing capabilities don't even come close to how powerful grep/sed/awk are. Grep and Sed both use regex, and the frequency with which those tools are used means the average Bash scripter has significantly more experience with it than the average PowerShell scripter.


DesertGoldfish

I'm curious to hear what you think can be done with grep sed and awk that you can't do with powershell


lanerdofchristian

grep/sed/awk all have equivalents, but they are all individually more powerful and expressive tools than any one thing in PowerShell. A lot of this comes from bash being a text-oriented system; when you work with just text, you get really good at working with text. PowerShell *can* do everything bash can, but it needs to compromise because it has a different model. It's the same sort of thing you see with any other difference in paradigms; C will never be as expressive as JavaScript for the asynchronous model, JavaScript will never be as expressive as Haskell or Ocaml for functional programming and data flow, Haskell just doesn't offer the same level of control over low-level faculties as C out-of-the-box because its model needs heavy optimizer passes in the compiler and runtime to run with any speed.


sysiphean

“I’m not as familiar with using PowerShell’s tools” != “PowerShell’s tools don’t come close to how powerful.” Stick with “I prefer to use what I’m familiar with that serves my needs.” That’s perfectly reasonable and respectable. Making the jump to say the unfamiliar inherently means it isn’t as powerful is proving the point about Linux admins.


lanerdofchristian

I have written significantly more PowerShell than bash (at least three orders of magnitude), and am vastly more familiar with PowerShell and the .NET ecosystem. PowerShell just hasn't had the need or the time to develop [*edit: text processing] to the same degree as bash and its ecosystem when it comes to text processing. If you can make every problem some kind of nail, you usually end up using some pretty good hammers.


floogled

But is there a powershell way of searching as quickly as you can with grep? Seriously have been looking for a way..


OPconfused

Select-String is pretty fast with -raw in Version 7. The slow part is getting the files if you're trying to grep through all subdirectories. I've toyed with a .NET file search which is much faster than gci, but it has that annoying terminating error when you don't have file permissions. There might be a way to pass robocopy with /L but I've never tried it.


sanjosanjo

I'm not an admin, but I prefer Bash on Linux and CMD on Windows mostly because the commands are much shorter. There is a lot of typing to do anything with PowerShell at the command line. I mean, even to get a PowerShell terminal open on Windows requires typing almost the whole word PowerShell before Windows presents it in the search result.


OPconfused

I've read this comment about command length several times on other forums which are predominantly bash users. This reflects a lack of understanding of how to use PowerShell. PowerShell offers aliases for commands that are 2-3 letters long, and it (also like Bash), provides a way to define your own aliases. But more importantly, you're expected to tab complete your commands, which is something a Bash user may not realize. The long command names in PowerShell are for clarity, something Bash users take for granted because they've been using it for decades and don't remember how mystifying everything is when you first bash. Between tab completion and alias setting it's trivial to use. As for opening PowerShell being annoyingly long to type, I really can't help you there. I've never seen a Windows IT user who doesn't know to put shortcuts on their task bar. You have to take little steps to make your workflow work for you.


concussedYmir

Or you can use the WinKey+X -> A to get a terminal with admin privileges in two strokes


nickjjj

As a crusty old UNIX greybeard still hammering away on a click-clacky IBM Model M keyboard, what is this “winkey” you speak of? :)


WDizzle

Because it’s made by Microsoft, simple as that. Linux Sysadmins tend to be quite snobbish.


[deleted]

You can also read a Powershell cmdlet name and understand what it does. Linux commands are purposefully obtuse in function, and they wear that like a badge of honor. Edit: here’s a list of commands/packages that are purposefully obtuse https://wiki.debian.org/WhyTheName


mini4x

>purposefully obtuse Like most Linux admins..


MaestroPendejo

I cannot find fault in your statement. Man, all of the most pompous SysAdmins I've met are die hard Linux purists that even hate on what flavor you use, they're all in camps. "You use Ubuntu? Filthy casual!" They make it to where you don't even want to ask another question. Then they wonder why people lean towards more easily picked up OS's. Yeah, Microsoft might suck, but I can usually find an answer to an issue without having to ask or get a bunch of snark if I do.


peacefinder

There’s a particular project which has a reputation for that hostility towards questions. I found it kind of annoying until I learned this crucial fact: if this system does not work like the manual says it does, it is a *software* bug not a *documentation* flaw. The manual pages are **authoritative** in every sense. They’ve put in a ton of work to do something hardly anyone else does, so I can understand them being a bit grumpy when people ignore it. The project is OpenBSD, and if you’re wanting to learn *nix systems and enjoy being thrown right in the deep end, it’s the best platform to learn.


BradsArmPitt

Obligatory, BSD is not Unix!


peacefinder

BSD is not *Linux*, but they’re (increasingly distant) cousins in the Unix family tree.


LikeThosePenguins

A diehard Linux fan at work told me exactly that. "I don't like Powershell because it's too easy".


EIGRP_OH

Not entirely true, I’m pretty sure a lot of the Linux commands are so small due to restrictions on string lengths back in the day. While I agree, Powershell commands are much more obvious what they do, I don’t think Linux commands are purposefully written to hide their meaning Edit: not sure why I got downvoted so hard, wasn’t even shitting on PS lol


vermyx

>Linux commands are purposefully obtuse in function, and they wear that like a badge of honor. This is not correct. There's a reason on why the commands are the way they are and actually make sense if you understand its history of linux. They're obtuse if you come from a dos/windows world and don't understand the history.


TzeroOcne

Is there a way to understand it without knowing the history because I'm too lazy for that


[deleted]

[удалено]


IonBlade

That's because whoami is not a PowerShell cmd, it's an external legacy executable at C:\windows\system32\whoami.exe that's being called implicitly because it's a default location in the PATH environment variable, so it processes its own arguments instead of adhering to the "-" standard for arguments PowerShell uses. The PowerShell equivalent of whoami would be $env:username. (If you need the additional data from whoami /all, you'd need to pipe the output into various additional commands to get those pieces, but you'd want to do this anyway in PowerShell to further use that data in scripts, because whoami does not return objects, only text, and text parsing is going to work out to much more code than calling commands that return native objects which can be passed down the pipeline.)


[deleted]

[удалено]


IonBlade

Same - the pipeline's use of objects makes PowerShell my preferred scripting language by far. I'll dip into Python if something I want to do is complex enough that I'd otherwise have to break out into native .NET code, but for most system administration and automation, PowerShell has native cmdlets to do just about anything I need for Windows and for Azure. I think a lot of what trips people up about PowerShell is not understanding the nature of how everything is an object in PowerShell, the difference between single string mixed data output from traditional apps vs. object output from cmdlets and (well designed) scripts, and how the pipeline maps objects from one command into another. If people were to read PowerShell in a Month of Lunches (or, if they want a lot more info than is necessary to get started but really take things to the next level, PowerShell in Action), I think that the "pipeline deals with objects" paradigm would really click and they'd see how PowerShell elegantly deals with some of the challenges other shells / scripting languages face. It's trying to treat it like a straight replacement for cmd and using legacy commands instead of their PowerShell equivalents where possible (and, where not possible, using something like Crescendo to wrap legacy commands into cmdlets that pass back proper objects), or writing scripts that output multiple types of data instead of unified objects so that they can't then pipe their scripts into _other_ cmdlets and scripts that makes it seem messy to people.


SlyFoxHayes

Use - for powershell cmdlets. It is a shell though, so when calling external programs, use the / - or — (double hyphen) as dictated by the program.


TzeroOcne

Yeah


[deleted]

Grep deez


LikeThosePenguins

Ok they may not be _purposefully_ obtuse. But still: anyone regardless of history could likely make a better guess at what **select-string** does over **sed**.


vermyx

Sed is almost 50 years old. At that time **stream editor** was too long for a file name. On top of thay you also had limitations for parameters and stream process (which is part of the reason for being able to compress single letter parameters instead of having them be individual) so yes history does matter as it will give you a why and how behind these tools. When I first saw **select-string** I expected to be more SQL like becauae of the select-object/where-object behavior and not regular expression.


PinchesTheCrab

Yeah honestly I probably would have called it find-string.


Life-Cow-7945

Yes, agreed


duderguy91

I use powershell for Windows administration, and I use bash for Linux administration. Personally it’s a convenience thing as well as just, what is the shell built to do best?


chicaneuk

Yep. If it’s Microsoft, generally they don’t want to know or care about it.


ThatGermanFella

Yup, we are.


SMFX

Just don't tell them about [Mariner](https://github.com/microsoft/Cbl-Mariner) or [Delridge](https://boxofcables.dev/building-cbl-d-microsofts-other-linux-distro/). Shhhhhhhhhh!!


barf_the_mog

I dont even think its that but rather the same question being posed again and again and again. Its tiring. I dont touch linux anymore and even i get sick of the discussion.


confushedtechie

Those who do dabble are always pleasantly surprised


timsstuff

Who cares lol. Let them keep using Bash while we work our magic. I don't have time for haters.


IDENTITETEN

I mean, they won't be using Bash for the stuff we use PowerShell to do. They'll be using Python which runs circles around PowerShell in regards to its capabilities.


[deleted]

They hate us cuz they anus!


_cronic_

Linux admin since 1996 here. I love Powershell.


dud8

First off, your posting in an echo chamber. Try taking this discussion to /r/linuxadmin. Second, there is a phrase along the lines of "if it's not broke don't fix it". Bash does it's job very well and has a long history behind it. The amount of mind share and knowledge surrounding bash, and other similar shells, is no joke. Typically if you need a more powerful tool it is better to reach for Python or an automation tool like Ansible. Most system administrators have very limited time to learn new tools so we have to do so strategically. Instead of spending time learning PowerShell, which is arguable a bit better then bash, it is better to learn Python/Ansible. Lastly, most tooling on Linux is closely integrated with either bash or sh. As an example, if you want to build containers you will need to use bash/sh in conjunction with whatever YAML/Definition files the tooling requires. Containers also strive to be as small as possible. PowerShell if massive, storage wise, compared to Bash. Some containers don't even ship bash and only ship with sh. Another example is with modern automation tools like Puppet and Ansible. These tools use their own DSL languages but also fall back to bash scripts as needed. Anyways, long story short PowerShell isn't a large enough improvement over Bash to replace it as the common default shell for Linux.


Billi0n_Air

both are just tools to get stuff done


mobani

IMO Bash is showing its age. Admins who don't go with either Python or Powershell or both, are falling behind.


IDENTITETEN

PowerShell is showing its age. Admins who don't go with either Python, Go or any other proper devops programming language are falling behind.


winter_mute

Neither of those effectively replace PowerShell as a convenient way of administering Windows endpoints. People who use PowerShell heavily are generally doing things on the Ops side. It would be an exercise in frustration trying to adminster Windows machines with Go programs. Also, compared to Bash (although I like Bash just fine) PowerShell looks amazingly modern with it's OO approach, and is *far* more readable. If you can read Python, you can read PowerShell. Not so with a bash script (especially if we're throwing in a load of DSL stuff like sed/awk etc.) There is no "proper DevOps" programming lanquage. You can achieve what DevOps is trying to achieve with any set of tooling that works for your environment.


mobani

How so is PowerShell showing its age?


IDENTITETEN

It's Windows centric in a world moving towards being OS agnostic.


mobani

Powershell Core is on Windows, Linux, and macOS. That is sufficient for 99% of use cases, so I would have to disagree with you.


IDENTITETEN

It's nowhere near useful on Linux nor MacOS.


mobani

That is very vague, what kind of problems have you run into?


Guyver1-

because bash is all they have ever used/know (and they instinctively hate anything Microsoft)


Cyber_Faustao

What I find kinda funny is that the same is true for Windows Admins. You can flip the situation and it will still be accurate. "Why do people use Apache? Everyone knows Microsoft IIS is the only Proper(TM) of doing everything" Humans, creatures of habit that treat the unknown as dangerous and frightenning.


Guyver1-

Not gonna disagree with that but I'd take it one stage further: Most windows admins couldn't PowerShell properly (as in, write production scripts etc) if their jobs depended on it. Far too many wintel admins are stuck in the GUI and MMC snapins and don't even want to learn PowerShell outside of one-liners found on the internet. In my last place, out of around 30+ wintel engineers across 1st - 3rd line and projects teams, I was only one of 2 who could actually write PowerShell code and understood what they were writing and produce production automation scripts. Linux admins have no choice but to learn bash as thats all there is, there is no gui on linux servers. So being a liux server admin 'is' using bash, all day every day. I deliberately made a choice 10 years to learn PowerShell because I could see which direction the wind was blowing and it would give me an advantage and a valuable skill set over other wintel admins. That has definitely paid off later on down the line.


Sh1ner

That's interesting as I come from a Windows sysadmin background, I am now certified in azure but looking at taking the lpic01 and switch to aws / bash world. I don't mind learning either. Both methods are useful skillset to have in my toolbelt. I probs get certified in aws after and go mult icloud.


PinchesTheCrab

I'll take it a step sideways and just point out that there are a lot of Linux admins who don't know bash. I don't understand how they get their jobs done, but I don't understand how to manage more than a few dozen Windows machines without scripting either. I guess they just do a mediocre job but keep the lights on.


duderguy91

I’m a Linux admin and I miss the simplicity of IIS tbh lol. Mostly because of SELinux. Every time I think I have everything configured right, security context isn’t set correctly on some directory and errors out the ass lol.


SeeJayEmm

Selinux is THE WORST.


nealfive

Most Linux admins are already pretty capable with bash, so they have no need for PowerShell really. Now folks coming from Windows to Linux love it as brings the same familiarity and cmdlets work and such, of course not all but close enough.


Wyatt_LW

Windows sysadmin here. I work with some linux appliances also. The problems with powershell on linux is it's not native. You have a random appliance, you can't just ssh into it and install powershell sometimes so you NEED to know bash. I see bash and batch as smart brother and dumb brother. Powershell is a step past bash and has more similarities with programming, it still lacks implementation on Linux and it simply isn't the standard.


Alaknar

I wonder if any distros out there have embraced it to an extent where it's actually possible to completely switch over.


agressiv

I use it, but it's incomplete at best, and rarely the best tool for the job. Windows Powershell > (Get-Command).Count > 1619 Powershell Core (Windows) > (Get-Command).Count > 1565 > Powershell Core (Linux) > (Get-Command).Count > 270 Some of the most basic cmdlets aren't there, and you end up using powershell just as a shell. it's great for stuff like native XML/JSON parsing, but not much else. Had they implemented DMTF CIM on linux, it would be a start. But instead, you have to shell out to dmidecode and do stuff like that in general, bash/zsh are better at handling.


WendoNZ

A million times this! Also there is a massive amount of modules that just don't work on linux


NoConfidence_2192

Windows PowerShell 1 and 2 were largely the same way in the early and many Windows SysAdmins felt the same way about PowerShell on Windows at the time


cottonycloud

PowerShell is admittedly overly verbose, whether it is the cmdlets or function definitions. They are also more used to using Bash and not the OO approach that PS takes. Another perfectly valid reason is that PS in Linux does not have 1:1 parity when used in Windows. Some cmdlets are not supported: https://docs.microsoft.com/en-us/powershell/scripting/whats-new/unix-support?view=powershell-7.2


swinny89

The verbosity is a feature. The bash way produces highly cryptic commands and scripts. Pwsh is just like reading regular english. The number of characters in the commands is also irrelevant, as tab completion is a thing.


Alaknar

>The verbosity is a feature. It's also an option. `gci -Pa .\Documents\ -Fi "*.txt" -R` I really don't understand why people bring this up as an argument *against* PowerShell... Like, "oh no, you can read this like English and instinctively understand what's going on" while at the same time having the *option* of making crazy complex and unreadable one-liners, just like in Bash.


DiggyTroll

It’s important to emphasize that PowerShell is an extensible engine that comes with a different set of “batteries included” depending on OS. In this way, it really is similar to python. Nobody complains that pywin32 modules won’t work on Linux, for example.


vermyx

>Nobody complains that pywin32 modules won’t work on Linux, for example. Correct, but if you do **ls** on powershell in linux vs powershell on windows you get different behavior and results because ls is mapped as an alias for get-childitem on windowd while linux will call the native ls. wget was mapped to invoke-webrequest and haa different syntax. Doing an os.listdir in python will return the data consistently between platforms. This is a major issue imho for powershell.


blooping_blooper

but that's not really an issue unless you're writing scripts, and you aren't supposed to use aliases in scripts https://docs.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/rules/avoidusingcmdletaliases


vermyx

Up until a few years ago wget and curl were aliased to invoke-webrequest. If you used those on windows you had to work around your muscle memory to use these tools in powershell, whether it was in a script or prompt. The aliases tied to common shell commands are a huge nuisance for people who have to support multiple platforms and versions because it becomes another "this behaves differently" to remember. So yes, it is an issue if a command behaves differently on a different platform (i.e ls gives you native ls on linux but dir gives you get-childitem on windows) because it adds unnecessary complexity.


mooscimol

I still don't get how it is an issue. Did you really used aliases in scripts, and they're broken on Linux, or you simply can't sitch to use gci instead of ls on Windows, or let's say create even more convenient alias like ll or something?


vermyx

Powershell prioritizes aliases over executables. Wget and curl as examples are useful command line utilities that come naturally on linux and can be installed on Windows which anybody whose been automating and scripting for years (I have since the early 2000's) would use these for automating processes relating with url request. Powershell's aliasing was interfering as powershell aliased wget as invoke-webrequest instead of using the command line utilities (the parameters are not the same and invoke-webrequest only does http/s) which for me was a nuisance along with the "compatibility" aliases (which were initially put in to transition batch file to posh easier). This particular alias wasn't removed until powershell core along with other linux related aliases, but the windows ones were left. This annoys me personaly because the way these compatibility aliases are applied/removed are inconsistent across platforms (i.e. you removed ls,wget, and others for linux but left dir and ls for windows) which cam be seen as a trust issue if your code can behave differently on different platforms.


mooscimol

Bash also prioritize aliases over commands, I think it's normal. I know what curl and wget are, but still can't see the issue. If you were using aliases in scripts, it's your fault. If you wanted to use curl on Windows (application, not alias) you could simple call it directly with curl.exe. Using aliases (in scripts) is always a bad practice because of the reasons you've strictly mentioned - they can be inconsistent across systems. Curl is no longer alias on Windows, because it is installed by default there. There is no ls command on Windows (although there is dir in cmd, but I think it is not an executable, but just dos command - I'm on Linux and can't check right now), so they keep it because it is very convenient.


K2alta

Does anyone here use powershell to manage a medium size number of Linux machines? Say for example, 30 VMs running centos. I’m curious because I’ve been learning ansible but already know powershell fairly well. Is it worth investing time managing Linux using powershell in an enterprise environment.


duderguy91

I would not stop learning ansible to try and use powershell in its place. Seeing as you are in the RHEL ecosystem, there are a lot of amazing developer tools available from Red Hat to take full advantage of Ansible.


[deleted]

If you get into Linux enterprise administration right now the killer skils to learn is ansible and python, there is still a lot of legacy bash script floating around but anything remotely complex is usually done with python. And we don't really logon interactively all that much anymore. Powershell is at this point and also ran that is only in the running because of how revolutionary having any real scripting capability have been in the windows world, it's not really gaining traction on linux where we have always had the pick of several high level programming languages for handling complex logic, i haven't personally heard of it being used on Linux for anything other then interacting with windows servers over the network.


[deleted]

I love these type of posts it really gets people chatting :) I myself am a Windows Admin and live in PowerShell all day, after hours I'm on Linux and use Bash and PowerShell... Trying to write scripts to to get server info for both Linux and Windows and a Server CMDB web app I made Once you know one they all are fairly easy


Szeraax

What's CMDB? :P


kerubi

I don’t hate it, manage both Windows and Linux. But would you use bash to manage Windows? I’d say the reverse applies..


NoConfidence_2192

I write most of most of PowerShell scripts using vscode on Ubuntu, RHEL, or CentOS. Often only switching to Windows when testing something developed for Windows It took time for PowerShell to get to its current state for Windows. It may have shown a lot of promise early on but, in all honesty, it was often easier to just continue to use the same command-line utilities, batch files, and WSH scripts you had been using to get things done before PowerShell came along. The biggest limiting factors for PowerShell 1 and 2 had more to due with .NET than PowerShell itself. As more system tools were rolled into .NET so too did PowerShell's ability to natively manage Windows systems increase. The way Linux SysAdmins view PowerShell on Linux now is not a lot different than how many Windows SysAdmins felt about PowerShell 1 and 2 in the early days...which is not too surprising when you consider that PowerShell 7.x on Linux is effectively Linux PowerShell 2.x. For Linux PowerShell shows a lot of promise but, in all honesty, it is often easier to just continue to use the same command-line utilities, shell and python scripts you had been using to get things done before. As more system tools are rolled into .NET so too will PowerShell's ability to natively manage Linux systems increase...assuming that happens.


lerun

I just dont get how people fail to understand that it takes time for something new to mature. It's like everybody expect it just to be born fully grown with no work needed. PS is new on Linux and many have to invest time to build out it capabilities on the platform. So instead of bitching maybe help and build out what is needed. The PS team has created Crescendo, so one can wrap existing command line tools into PS. https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.crescendo/?view=ps-modules


caverCarl

Bash is what they are used too. It is designed to manage Linux unlike powershell which is designed to manage windows. There are a lot of quirks to powershell such as it's inconsistent return values, naming conventions etc. that are not easily anticipated by someone who is used to things being done a different way. Simple example try typing LS in bash, windows doesn't care. We are slowly approaching a point where the shell won't matter but we are not there yet. :)


hlt32

As if bash doesn’t have quirks …


gex80

I like objects.


wigelsworth

I objectively object objects.


[deleted]

fire spez -- mass edited with redact.dev


hayfever76

As a person who regularly uses PowerShell on Linux, Mac and Windows I can't disagree more. Bash is definitely it's own beast and does some cool stuff but with PowerShell I can use the same piece of code across all my OS's.


thespoook

I have a follow up question, if you don't mind. I used to be a Windows guy, and user PowerShell scripts to get stuff done. Moved to Linux some time ago and now use mostly bash. One thing that used to annoy me was how PowerShell commands would work on some Windows systems and not on others depending on the version of PS and what cmdlets were installed (I think that's what they were called). It felt like MS we're still changing it around a lot which meant (at least to me) that I couldn't just depend on a script to work across different versions of Windows. Is it a lot more consistent these days? Ie has it basically stablised now it has become a more mature platform?


cottonycloud

Not the person who you replied to, but generally the PS version is dependent on the operating system you are on. Any hardware on W10/Server 2016 or newer will have Windows PowerShell 5.1. Since 6.0, you can install the cross-platform version side-by-side with 5.1. I just install 7+ on basically anything. https://docs.microsoft.com/en-us/powershell/scripting/install/powershell-support-lifecycle?view=powershell-7.2


thespoook

Thanks for the reply. Oh wow. Up to version 7 already! Yeah my memory comes from the early days of W10 when you still had a lot of W7 machines around, some 8 and 8.1 and more and more W10 machines. I know I could Google this, but since I have you... Are a lot of the commands similar on the cross-platform version of PS? I'm thinking actions like copying files etc... Also is it Linux distribution independent too? Like works on Debian based Linux as well as other flavours?


cottonycloud

In the link I included, there are some articles comparing the differences between 5.1 and 7, as well as any missing features from going to cross-platform PS or using a different OS. In regular usage, it's highly likely that you won't lose any features besides some obscure cmdlets. There may be some modules missing on the server end (especially on 6, which prevents many from switching over), but in version 7 they added a shim that allows you to use nearly all of them. https://docs.microsoft.com/en-us/powershell/scripting/whats-new/differences-from-windows-powershell?view=powershell-7.2 https://docs.microsoft.com/en-us/powershell/windows/module-compatibility?view=windowsserver2022-ps


thespoook

Thank you. I appreciate the time taken to answer. I'll definitely check out those links and maybe take another serious look at. PS. It would be nice to have a single scripting language to manage all my servers rather than having to get familiar with numerous different ones.


Alaknar

>Thanks for the reply. Oh wow. Up to version 7 already! It's a bit tricky. Unless it changed relatively recently, the idea was that version 6 was supposed to be the cross-platform but on-par with version 5 (so 100% compatible) while version 7 was cross-platform and included new things as well. Both were getting releases simultaneously.


4478933aaff

I use PowerShell on Linux all the time. I run containers with PowerShell, and I deploy PowerShell-based applications to Kubernetes clusters, with exclusively Linux slave nodes. I use PowerShell with kubectl to more effectively manage resources on k8s clusters. Anyone who holds a grudge against PowerShell is just making themselves less productive, lol.


vermyx

Many linux administrators have coding experience because the mentality has always been "automate everything" from the get go. Windows was always "GUI first" until 2008 or so. Remember, win2008 was supposed to have all powershell administration (since it was supposed to have a guiless mode) to the point that there wasn't a GUI tool to configure IIS (where there waa sufficient baxklash and bitching that a GUI for IIS was made). With linux bash and python have been available on linux for over 30 years while posh core has been there for 5, doesn't have feature parity with Windows, and has slight behavioral differences. In other words, linux already has robust and mature toolsets while powershell offers nothing new and isn't the same cross platform.


gex80

BASH isn't really the powershell competitor. CMD is to BASH as powershell is to Python. Anyone who compares BASH and powershell doesn't understand either.


swinny89

Not really. Powershell is designed with on the fly system administration in mind. Python isn't. Pwsh is my default shell on Linux, and I have have zero issues. You would have to be a different kind of person to live in python.


commandar

So, the way I view it is that there's kind of a continuum of sysadmin tools. The thing that makes Powershell particularly useful is that it largely bridges the gap between a traditional shell and a more powerful general purpose scripting language. The utility of it is the fact that there's a lot you can do with strictly Powershell that you'd have to resort to offloading to something like Python in a more traditional shell environment like bash. Output being both object oriented *and* pipeable is incredibly powerful. Being able to run a query from a shell, filter it as an object based on member properties, and export it easily to a CSV is something that you'd normally have to drop into a more full-fledged language to accomplish from a traditional shell. You can do all of that in a Powershell one-liner. That tends to make up a large portion of any given work day for me. As somebody who regularly jumps between both Windows and Linux, there are things I appreciate about both. But to respond to the GP: Powershell isn't a direct competitor to CMD or bash or Python; it's in a space that kind of bridges the gap between all of them. There's a level of complexity where I'd 1000% rather use Python than Powershell, but there are a *lot* of times where I appreciate not *having* to drop to Python to get something routine done.


TheRealMisterd

>. Powershell is designed with on the fly system administration in mind. Then why do I know so much .net stuff to make ps script work better? Also, where is the space folder ? (Test-path " " )


ExceptionEX

I would argue if you cant see how bash and powershell are similar, you should take a closer look. But are several ways you could compare them, I'm not trying to start a debate, just saying.


4478933aaff

Agreed, anyone trying to compare Bash to PowerShell has no clue what they're talking about.


Magma151

I don't see how you could NOT compare them from a sysadmin perspective. At least when comparing Linux administration to windows administration. PowerShell core I can maybe see the point. But the regular windows version definitely serves the same purpose as bash for it's respective OS.


ExceptionEX

Because they have had tools like for years, bash, tcsh, hell even pearl. The whole ecosystem supports them natively. PowerShell is great, but in Linux it's just a tool with new syntax to do what they they been doing for years.


NightH4nter

in no particular order: - takes too much typing - requires having explicitly exported modules - works on objects instead of plain text - made by microsoft to be continued (?)


Ihadanapostrophe

What do you mean "requires having explicitly exported modules"?


NightH4nter

if a program doesn't export a powershell api, you can't work with it using powershell. you can call the executable of that program and pass some flags into it (provided that the program has some sort of cli in the first place), yes, but this is how unix shells work, not powershell


rswwalker

I think the ease of Linux commands comes from the Linux OS where everything is represented as a file so it all boils down to text processing or byte streams. In Linux you just need to know the commands, their options and the layout of the filesystem, which most people know in any OS. In Powershell though, it’s all objects and each object has different methods and properties you have to memorize along with the cmdlets and their options, as well as the different virtual “filesystems” disk/wmi/cert/ldap and new ones pop up all the time. Powershell is daunting and often requires you to work off MS reference docs instead of just scripting it free hand.


Nu11u5

Imagine thinking text parsing is superior to objects. That said, on Linux something more supported like Python may be better, but you don’t get the advantages that PowerShell has like pipelining and simple invitation of shell commands.


RumRogerz

Most Linux admins have never touched powershell. That’s why. Powershell is way, way easier to script in compared to bash. Bash has a lot of annoying quirks and rules that gets really frustrating when you’re trying to script everything out. Just thinking about the different ways to handle variables comes to mind. Or the placements of single or double quotes. Or creating objects. Good god life would be so much easier if I could create objects and use them in bash. Bash isn’t better. It’s just the shell that we always use in any given system or container - and that’s really important. If I drop into any of our nodes - bash. If I drop into (most) of our containers - bash. I’m not gonna be installing powershell. None of us are going to use it. None of us want it to be added in either. It’s going to cause more overhead - and we try to keep things as light as possible. I learned powershell when I was a Windows system admin because it’s the preferred shell to manage windows server and exchange. I learned bash because it’s the default and kinda preferred shell to manage unix. Granted, zsh for cli work and bash and (mostly) python for scripting is my preferred method.


theremote

This is right. I learned PowerShell when my responsibility was to manage Windows workstations and I learned bash when I started running servers/applications that used Linux. This has been more than a decade now. I think you're right that bash is harder than PowerShell. Way harder. All of the quirks that people complain about with PowerShell? Wait until you see the quirks when scripting in bash (especially across distros and variations between shells like bash, zsh, and all the others). Neither of them are really "better". Definitely neither of them are perfect or anything even close to it! It's more about using the right tool for the right job. You're also correct that a lot of the Linux sysadmins will not have had any need to use/learn PowerShell and that is really where any perceived "bias" is coming from. It's not personal (usually, we all know a few Linux people that hate Microsoft so much it is personal but generally speaking it's not).


shavedbits

as a seasoned linux / mac user who now has to deal with windows frequently, i think psh is just difficult to learn coming from bash. i still struggle almost a decade after having to use it.


mrcoffee83

Linux nerds can be incredibly elitist, even amongst different flavours of linux, they'll call you a loser for using Ubuntu instead of Arch or god forbid you use Nano instead of THE LORD AND SAVIOUR, VI


SeeJayEmm

I've been using *nix both personally and professionally since the mid 90s. I grew up on slackware, and *bsd. I hate vi. I can use vi, but I don't want to.


[deleted]

I think because it's poorly named. It's not a shell, not really. It's a fancy human usable API. I like powershell a lot, and am far from a Linux admin, but I think the name sets a poor expectation on that group. It's a wonderful management tool, but a lousy user shell.


TheBananaKing

I fucking love powershell, it's just not useful in my environment.


yesudu06

I don't hold a grudge against PowerShell, it's just useless (or, "I strive to find a use for it"). bash is a better shell, python a better scripting language, and ansible a better configuration management tool. I originally chose PowerShell to define DNS records in ActiveDirectory, as it seems the only way to automate that. The cmdlets that allow this only work on Windows. I discovered PowerShell is awesome, I very like the syntax, and dealing with objects is much more convenient than doing the "stuff | grep | awk | jq | ..." that sysadmins usually do... So I have PowerShell Core installed, I use it once in a while when I have a very specific usecase where I need a one off ad-hoc query to extract one thing once. I actually documented a case like that (extracting stuff from a rest API and presenting the result) and the first comment is someone giving the commands with curl and jq. PowerShell is more elegant to do very few things.


More-Qs-than-As

Powershell is a great shell on linux. But too many years of "fuck microsoft" and any linux guy/gal won't touch anything MS makes with a 10-foot pole. I use it daily on Linux. Powershell is my main shell on linux and you know what I can still say, FUCK MICROSOFT! Powershell is one of the only things microsoft has ever done right. It's a shell *and* it's a programming/scripting language. Now it's both open source and cross platform. If that's the shell/language you first learned, nothing else will make sense. Same goes for bash. If you learned bash first, everything else is foreign and not worth learning. Took me over 10 years to move from CMD to powershell cuz it just didn't make sense. Now, Powershell has been my job and my life for the last 6 years. I automate everything. Even in Linux.


lerun

I'm so old I started on vb script, though PS was a god send. Have never regretted moving to it.


Dereference_operator

no offense but there is many comments here that say Powershell can't do much on Linux vs Bash etc have you run into theses limitations ? or your knowledge of Linux isn't good enough ?


ExEvolution

Because microsoft


SRone22

Ive run into too many over zealous "security" conscience Linux admins. If it didnt ship with the linux distro they refuse to install an app or tool to help with administration so they simply stick to what they know and are approved to use. Bash is literally parsing text with the most complicated syntax that only makes sense after years of use. But boomers do what boomers do. Same with fanbois.


chronopunk

https://www.reddit.com/r/linuxmasterrace/comments/ozc178/bash_is_the_worst_powershell_ftw/?sort=top


FuegoFamilia

My net engineer was a pretentious UNIX snob, did all his scripting in powershell 🤷‍♂️


os2mac

if you think they hate powershell ask them how they feel about systemd.


danstermeister

It's the third option- they don't KNOW it. If they realized they were wasting time parsing output while PS preparses it for them they might take a 2nd, more serious look at PS. Also PS6, while completely necessary in the development of PS was also not completely helpful to either Linux or Windows users. It was a beachhead on Linux and most windows administrators wisely kept using PS5.1 at the time (any many stupidly continue to today). Now PS7, while not perfect, is a significant development for both groups. It's use for me is that I can concentrate on one scripting language for all my OS', it preparses responses cutting my dev time, and it serves as the easy glue between my mostly Linux environment and our company's back end o365 operations, in particular SharePoint. At first I hated it, too. I'm an old school Unix neckbeard that saw pre-ps5 as immature and unnecessary since the world already had sh/bash,perl, and others. But as it and myself matured a little it became more obvious that PS was playing the long game... and PS7 is but a hint of that.


Dereference_operator

but what's your opinion about the many comment here who say you can't do much with powershell on linux compared bash/python/ansible.... have you run into theses limitations yourself ? or you can use powershell to do most of everything you want or great scripting/automation WITHOUT using bash/python/ansible/kubernetes etc etc


RandomXUsr

bash because it's much less object oriented and more explicit and functional. powershell is more object oriented and convoluted. That said; it's also faster than bash in many cases.


swinny89

Powershell is much heavier than bash. You would be hard pressed to find a situation where PowerShell is faster than Bash. I've used them both side by side for a while, and compared all sorts of tasks. Occasionally they had the same performance. Usually bash was much much faster. That being said, more time was saved overall as actually doing tasks in powershell is often simpler.


GenericAntagonist

> Powershell is much heavier than bash. You would be hard pressed to find a situation where PowerShell is faster than Bash. In practice you are spot on, but bash also doesn't have lots of things in it. You can call all sorts of external tools (that are also rather optimized) really well with it (i.e. curl or wget to hit a web endpoint, or jq to parse json) but if you went language to language, an http client or json parser written completely in bash would almost certainly be slower than invoke-webrequest or convertfrom-json.


mini4x

Gatekeeping snobs, it also might be a doorway into higher Linux use, so they should embrace it...


goodtimetribe

I love powershell, even on Linux. I'm comfortable with OOP and enjoy C#. Seriously, you can pipe _objects_ instead of just strings. How cool is that! Sometimes I hate the semantics and the weird quirks it has to accommodate the Windows platform (escaping) , but they are relatively few so it's not too bad to keep up with. I think it performs fantastically on Linux, and prefer to dev powershell on Linux because of it.


lordlionhunter

Powershell is a fine automation language and to many it’s analog is python, more on that later. It can even be a nice enough shell if we are comparing it to default bash. Compared to a fish, zsh or even just a configured bash it’s missing many user friendly features such as spell check, impressive stylistic designs, vi key bindings and a whole lot more. Python has the REPL where you can use out like a shell. This is equivalent to running a powershell prompt as your shell. Many say that powershell is analogous to python but I would say that bash/standard Unix tools can keep up with anything powershell can do. Powershell as a language is helped/hindered by its object oriented design. I’ve had tones where the object nature of powershell passed through pipes was fantastic. But most of those times I only needed something to be an object because Windows exposes everything as an object too. Python, has objects and things like that but it also serves in the role of awk, sed and grep. These are tools that work well with text based files, which is how all of the Linux OS works. Powershell doesn’t play with csv’s or other tabular data as well as tools with Unix heritage like bash or Python. Powershell makes you get your data somewhere in an object. This isn’t terrible most of the time but it can make working with text files more tedious. [This](http://www.leancrew.com/all-this/2011/12/more-shell-less-egg/) is a great article on an old debate between Doug McIlroy and Donald Knuth. Powershell is likely less annoying to write than Knuth’s language (idk I’ve only done Powershell), but it isn’t built to treat text the way you can with Unix tools and by extension bash and Python.


LikeThosePenguins

I think it's historical, in some cases. For years, Linux/UNIX was the complex and powerful OS on which you did actual typing and writing scripts. Windows was the clunky, flakey OS that made you do everything slowly with a GUI. I think there's a demographic of Linuxy folk who see Powershell as encroaching on their territory.


gatobacon

If'n you's likes thems PowerShells thens you's can use its. If'n you is preferred to use them Bashes by all the means. They's is mine opine dats all up to them they's or theirs preface.


JM-Lemmi

I think many Linux admins have something personally agains anything Microsoft. So Powershell being one of MS's products, they of course also don't like it. I really thought after high school you'd leave the "Linux Masterrace" crowd behind, but I've still met too many of that mindset...


Sylogz

I'm a Linux admin and a windows admin. I didn't like powershell cause it was terrible in the begining but now it's awesome. And just like bash, python, perl it's a tool to be used to solve problems.


dogfish182

Bash and python is just a far better combo and powershell is just not necessary for managing Linux at all, just another complex tool to do something other tools already do bettet


SeeJayEmm

The best tools for the job are the ones you know. Back in my FreeBSD days I was a tcsh snob. I thought it was objectively better than bash (I was also a bit of a BSD snob. "Linux wasn't real Unix"). I've long since grown out of that attitude. Looking back now I realize that a lot of it came from what I was comfortable using. My point being. Of course career Linux admins are going to prefer that tool they've been using their entire lives, that has come pre-installed on every Linux system, and has literal decades of history. pwsh is an upstart. By a company that used to be "the enemy". It's going to take years to both mature as a product as well as earn trust from that community. In the interim those of us who straddle the line can keep pushing for improvement and adoption.


[deleted]

I'm cringing at some of the responses. People are trying to make this an ideological argument. Just because someone doesn't believe what you believe or agree with your opinion doesn't make your belief or opinion any less valid. It's okay for someone to not like what you like, even if they don't have any experience. They don't have to justify their opinion or get your approval to feel that way. People use what they're comfortable with and specialize in what their employer requires. You'll never see a job opening for a Windows Sysadmin that requires familiarity with bash and you'll also never see one for a Linux admin requiring PowerShell skills. Hell not even all Windows Sysadmin even use PowerShell but ALL Linux Sysadmin use bash.


3legdog

Pro-*nix bigotry has existed since the 70's. Get used to it.


Rocknbob69

Linux elitist snobbery


wickedang3l

Humans don't like change and anyone that has overcome the steep learning curve of addressing everything as a string has also become accustomed to the inherent performance superiority of handling everything as a string. Even python, which is typically known for better performance than PowerShell, is not known as a high-performance language. There is overhead in assembling those lovely objects we have grown accustomed to. PowerShell was my first scripting / programming language and remains my favorite but its limitations become more apparent as your skills develop and you begin concerning yourself with performance optimization, multi-OS interoperability, and sensible error-handling. You find yourself spending a lot of time trying to fit PowerShell into a design pattern it wasn't meant for rather than simply learning something like C#, python, or Go. You can actually see when people are beginning to approach this point in their code. When someone begins calling more .NET namespaces than native cmdlets, they're close or already have come to the realization that native PowerShell is not the best fit for everything.


mspit

I don’t have real experience with PS on Linux but I’d assume that just not what most are used to. Generically, I think PS is frustrating to some because everything is so verbose. I know there plenty of shorted alias but rarely enough to keep things short in a more complex command that you might frequently type out. PS was notably build from the ground up with some neat concepts but there are still plenty of inconsistencies and gotchas that and just as frustrating as they might be for someone trying to learn bash.


SoarinFerret

Not all of them do - it's about the right tool for the right job. As other s have mentioned, PowerShell is object / api based, just like Windows. Everything in windows is exposed via an API, like WMI or CIM. Bash has a hard time interacting with those since it's designed for text stream stuff. I use PowerShell and Bash on both Linux and Windows - there are times pwsh on Linux it's useful (aka, automating some cloud service rest API), and likewise for WSL. Nothing wrong with either approach, and I highly recommend people learn both. Both are just another tool in your belt.


catonic

The only thing I have against Powershell is that it is a moving target of OS requirements. Exchange Powershell has it's own requirements and so on, so you're always building a VM with the minimum requirements for a given Powershell subset, as long as there are spare resources to go around. New version? New subset? New OS, etc. It'd be one thing if you could cattle-not-pets Windows environments.


storm2k

shell scripting was designed to work with the way unix works, which is many programs that make up the tiny building blocks of doing various important things with output from one piped to the next (which pwsh borrows) but it wasn't object based. don't forget that pwsh was also designed to work with the .net framework originally and even though .net core is cross platform and open source, it doesn't necessarily mean that it either works exactly well for needs on posix based systems nor that sysadmins and others who support these systems want to learn a whole other scripting language and paradigm that may or may not fit their needs. last point, i find it telling that most of the pwsh cmdlet aliases happen to be their unix shell equivalents (ls, rm, pwd, ps, etc.). not making any conclusions, just pointing that out.


ms4720

When you tell a unix/Linux person '*shell' all they hear is 'shell' that is a very specific thing to us. PowerShell is not shell it is an object oriented scripting language with deep windows integration. It is honestly closer to python than shell


Tireseas

Resistance to dealing with learning curves mostly. If they're pure linux admins that's fine in the case of powershell as there's no real need to know it on that side and even if you do dabble the native tooling is objectively better in most cases. If they're also Windows admins and don't know powershell by now... well that's just sad really.


mmd03876

I've worked on both windows and Linux for many years. I wouldn't call it a grudge so much as Linux admins simply don't need PowerShell. Linux has had automation and scripting capabilities built in long before PowerShell was a thing, much less available on Linux so people continue to use what they know Plus bash (and sometimes python) are native to most distros. So unless PowerShell can offer something above and beyond what Linux already has available, there's no reason to switch. With that being said, I think PowerShell is a great tool for managing Windows systems, but I wouldn't use it for anything else


tangokilothefirst

shoot. pwsh on linux is my favorite combo these days. I love easy access to the object-ness of powershell, with the added benefit of the plethora of linux tools that I am familiar with.


Hrambert

I've been using Powershell since v1. I really like the syntax, tab completion, and "everything is an object". For Windows it was the only forward. WSH was way to complex and CMD way to basic. Linux sysadmins can pick one of the many shells that are available for Linux. So Powershell has many competitors and the disadvantage of being object oriented. It's hard to switch between string oriented en object oriented.


maikeu

My primary background is Linux, and I use PowerShell on Linux sometimes - not my choice, but there are existing scripts to maintain. Python is a standard system component on most Linux distros, and the overlap between "PowerShell would be better than bash for this" and "python world be better than bash for this" is extremely high. Python is (to me) much more productive for harder stuff, and bash is more comfortable for the simple stuff. I appreciate the effort of PowerShell core and the ecosystem being cross-platfrorm now. I don't use PowerShell for new automation (unless it needs to run on windows), because it is not the best option for me and my colleagues, in my professional opinion. On the other hand, anyone who genuinely "has a grudge" in a professional setting is being immature and unprofessional.


follow-the-lead

I don’t like powershell cause the error messages seem to be so wordy without being belpful. Why do you need 5 lines to tell me a module isn’t installed? Also, module installation seems to be a painful process and there are a lotta hoops to jump through. Something something proper package manager


t35345

I feel it's too verbose so your single-liners end up massive. Otherwise as a Linux Admin I love PowerShell, it's the best CLI that you can get on windows. Better than VBA or Batch commands. I wouldn't install PowerShell on Linux unless I was having to manage lots of Microsoft stuff like o365


Eideen

I have always avoid powershell do to i be much harder understand the [syntax](https://mathieubuisson.github.io/powershell-linux-bash/), it harder get help in terminal. With windows be GUI the need to be comfortable in terminal has not been needed. The lack of open-source, and user contribution have made it less user-friendly. Windows has lack many basic functions like ssh, that now has been introduced. Windows does not come with a rich Prompt by default , and to make customized is harder.


[deleted]

The short answer is "Because we are answering a different question that the one you think you asked" The short answer is because it is not better then python, perl or go, And the reason this is the question that gets answered is that we don't actually use bash to manage Linux but a number of stand alone tools invoked via bash where as powershell tend towards an model where you use powershell and powershell extentions the same way you would use modules in the far more divese python ecosystem.


Adeel_

Because they are stupid.