r/PowerShell • Community Blogger • 1d ago

News Why developers hate PowerShell

https://powershellexplained.com/2026-11-24-why-developers-hate-PowerShell/?utm_medium=post&utm_content=rpowershell&utm_source=reddit

This is a post that I have been thinking about writing for a very long time now. I find that developers struggle with PowerShell in a very different way that the sysadmin learning to automate. They bring intuitions and assumptions with them from other languages that catch them off guard when they skip over the documentation. In this article I try to capture some of those experiences and misunderstandings.

I cover a lot of ground in this one: running scripts, execution policy, aliases, objects and formatting, calling functions, output and return values, unrolling, operators, case sensitivity, type conversion, truthiness, strings, scope, automatic variables, paths, encoding, errors, native commands, and classes.

While this one is targeting Software Engineers more then Systems Engineers, I would still appreciate your feedback and stories of your own frustrating experiences.

Thank you, -Kevin

262 Upvotes

76 comments sorted by

49

u/aguerooo_9320 23h ago

Top quality u/KevMar, I'm hoping more people will read beyond the title and a quick diagonal glance, to understand that this is actually a helpful article for a developer starting to work with Powershell, to ease their experience.

16

u/KevMar Community Blogger 23h ago

Thank you. I appreciate it. It was hard to strike the right balance with this one. Still not sure if I got it.

I think the calling functions section captures the heart of it the best.

7

u/aguerooo_9320 23h ago

It is a step by step helpful journey explanation from the POV of a developer, absolutely top notch!
With this opportunity, thank you for all your blog posts, it's already 8 years since I've read the first one!

20

u/kagato87 20h ago

I've converted my dev team. They've learned that, while.it is an interpreted language, it's also a fully capable object oriented language. Like a JIT language except it doesn't actually need any compile at all, and is crazy easy to debug.

11

u/KevMar Community Blogger 20h ago

What I loved was how self discoverable everything was. I could make an API call, get the object, then trivially look at what it contained to know what I needed to do next.

1

u/kagato87 20h ago edited 20h ago

$response.result[0] | select * | ft

Don't always need the pipes, but yea that's da bomb integrating to an api. Sure, the dto is available, but just looking at the data is easier.

Even working in a C# project I'll crack out a powershell harness to find the dot notation to the data I'm interested in.

7

u/htglinj 20h ago

Crazy easy to debug…compared to C# it is not.

PowerShell is an abstracted framework written in C#, anytime I need to do something really heavy I have to dump down to raw C#. Then I’m wondering why I’m abstracting to PowerShell.

1

u/KevMar Community Blogger 19h ago

I have caught myself using PowerShell for way more than I should at times. I'm much more willing to toss some C# into a dll for my PowerShell to leverage when it makes sense.

1

u/mkeytail 16h ago

Well you won't have to, as Single-File c# will be taking over ultimately, no ?

1

u/KevMar Community Blogger 15h ago

It's more use PowerShell for what it's best at and C# for what it's best at. If I'm not needing to call other PowerShell commands and it's mostly data processing or computer science stuff, then I do that part in C# and I'll lean on PowerShell for the shell experience that I want.

3

u/SupremeDictatorPaul 16h ago

Because writing something in PowerShell takes a fraction of the time, and you can always view the source. Although, with AI now, the time savings aren’t really relevant. I do find it easier to read, but again, if you’re getting a summary from AI, then I’m not sure it’s going to matter much. Certainly for a lot of sysadmin stuff, a line or two of PowerShell can accomplish what is a whole project in C#.

14

u/Solonotix 23h ago

I hit almost every single thing you've mentioned, lol. As a developer on Windows, PowerShell is my go-to for scripted actions, and I have been bitten so many times by these various gotchas. I like to think I'm on the other side of this bell-curve, though, where I'm now starting to use these eccentricities rather than being caught unawares.

For instance, the gotcha about multiple return values in a function scope. That's just how pipelines work. You want to make a lazy-ish pipeline? Just allow a value to be returned without a variable to capture it (and no return keyword). On the caller side, they can abort that execution with ... | Select-Object -First ... and you didn't even need to account for it.

The exception there, of course, being that you might have a disposable resource like an open file or connection. The gotcha I then hit (feel free to add this to your article) was learning that the End { ... } block does not work like you might expect, since internally PowerShell is calling the blocks Begin { ... } then Process { ... } then End { ... } with an implicit End { ... } block if you omit all of them. Side note, the special function keyword Filter has an implicit Process { ... } block instead. Anyway, all of that to say that a disposable resource can now be safely handled in a Clean { ... } block which will always execute upon exit, even when something else aborts the processing of a function/command.

This was a really big lesson for me when I was trying to do a TestRail upgrade (that royally sucked). Had to do a lot of database calls and relate it back to the file system, and I had already uninstalled all of the crap needed to complete their install instructions (e.g. Python 2.7, JDK 8). So, I dropped down into the .NET side of things and got into using [System.Data.SqlClient]. My first hitch was that lingering open cursor from one function call, and it was going to prevent subsequent queries from being run because the result set hadn't been disposed of. The Clean { ... } block was only added in PowerShell v7.3 so I shudder to think what the code would have looked like prior to this. I probably would have dropped into a C# class file and imported it with Add-Type but that begets its own realm of troubles lol

6

u/KevMar Community Blogger 23h ago

Nice call out. I absolutely need to find a place for that in my article.

5

u/Solonotix 22h ago edited 19h ago

Do you happen to have any articles covering the weirdness and use cases for the various common types in PowerShell? I tend to use explicit type annotations for things, and I've noticed differences in how some things are handled, as well as what AI agents recommend.

For instance, the [ordered]@{} type. I used Get-Member on it, and it said it was Something like [Systems.Collections.OrderedDictionary] (might have the wrong type), but it behaves differently from that explicit type. It's like [ordered] is its own discrete thing that works with the object syntax. This of course is different than the default result of the declaration @{ ... } which is [System.Collections.HashTable] as well as the ubiquitous [PSCustomObject]@{ ... }

5

u/KevMar Community Blogger 22h ago

I don't recall if my hastable article covers some of that. I remember fighting with [ordered],[hashtable], and $PSBoundParameters not having consistent methods across all three for checking if a key exists at one point. I think my solution was to cast everything to IDictionary at the time. I definitely use IDictionary instead of hashtable when strongly typing parameters because of that.

4

u/surfingoldelephant 17h ago edited 16h ago

but it behaves differently from that explicit type

Because [ordered] is special-cased in the parser (similarly with [pscustomobject] and [ref]).

There's a semantic check that prevents anything other than a hash table literal following it because it's not a real type in Windows PowerShell. It's kinda like an attribute (but not really) that tells PS to produce a case-insensitive Collections.Specialized.OrderedDictionary instance. That dictionary type by default is case-sensitive.

[ordered] was added as type accelerator in PS v7, hence you can do [ordered]::new() in that version, which is the exact same as [Collections.Specialized.OrderedDictionary]::new(). But with conversion expressions, you can still only do [ordered] @{} because the semantic check that prevents anything else is still in place.

Also, side note, there are slightly different conversion rules depending on whether you type-constrain or cast. For example, $var = [bool] '' is fine, but [bool] $var = '' is not. Something to watch out for if you type-constrain a lot.

23

u/AngryPets 23h ago

Kevin - this is GOOD STUFF(TM).

Initially, my thought was that a better title might be "Common Pitfalls for Developers Learning PowerShell" or ... "How PowerShell works for Developers".

As a C# developer, learning PowerShell was ... trivial. EXCEPT for all of the damned exceptions to what I EXPECTED would be the case for a LANGUAGE (PowerShell) ultimately 'written' on .NET and/or with the idea of being able to natively run .NET code, return objects, and the likes. So much of what I would've expected and or took for granted ... just wasn't the case. Causing plenty of lost hours, a bit too much cursing, and serious frustration with PowerShell.

And you've nailed it. Learning PowerShell as a developer? meh. Actually using it, you're in for a few shocks. That'll piss you off.

Like ... left-side-wins. For a C# developer that's not just blasphemy, it's unthinkable (a design goal of C# was to get rid of that 'holdover' from C++) - so left-side-wins is SO counter-intuitive.
Arrays, yeah, more like duck-typing from JS. Confusing and odd - compared to your expectations. WICKEDLY delicious once you get what's going on AND what you can do.
Can't tell you how many times I LOST an hour here or there (back before AI made a LOT of this shite trivial) cursing PowerShell cuz it just swallowed my well-named $input variable.

And I'm guessing that SysAdmins, 'scripters', and other folks familiar with "shells" are likely going to poo-poo a number of the details you've outlined here.

They're not your audience. And yeah - this all stuff I've HATED about USING PowerShell until I've been able to make most of it second nature (and migrate fully to the "Dark Side").

6

u/KevMar Community Blogger 20h ago

Awesome. This was one of the reactions I was hoping to get.

I have so many style rules to mitigate these things that I sometimes forget why I have the rule until I break it and I am quickly reminded as to why.

0

u/caderoux 12h ago

Also the incompatibilities and quirks between Powershell versions. I literally have a test suite for 5 and 7 because Claude knows how incompatible they are and that everything needs to be tested against both. Developers will be fine and then send a script to a different machine and have all kinds of problems without doing that.

1

u/KevMar Community Blogger 9h ago

I have been developing in compatibility mode for so long that I forget how big of a difference there can be. I haven't really adopted the new stuff in 7, yet I have stopped using all the stuff in 5.1 that isn't in 7.1 a long time ago.

11

u/BlackV 22h ago

Holy smoke, Mr Kevin Marquette themself, Ghost from posh past and blog king, Welcome

11

u/KevMar Community Blogger 22h ago

Just me sneaking in here and casually dropping a 7000+ word post. Thank you for the welcome.

4

u/Inevitable_Butthole 21h ago

Can I get an autograph?

2

u/KevMar Community Blogger 21h ago

I'm a regular at the PowerShell summit. Usually one of the last ones up late.

2

u/milkmeink 20h ago

Your username is fantastic!

2

u/BlackV 21h ago

It's a great read.

5

u/me_again 21h ago

I think PowerShell has a lot in common with JavaScript or bash. They are the default languages for certain kinds of activity, but as languages they have quirks which are now unfixable due to back-compat concerns and which grate on developers who want a "Real Language" suitable for writing large systems.

I still remember discovering that @[] -eq @[] is neither true nor false, but an empty array 🤯. Which is explained clearly in your doc but I still maintain is a design flaw.

2

u/KevMar Community Blogger 19h ago

I might need to add that example into one of my other articles.

1

u/SupremeDictatorPaul 16h ago

Honestly, a lot of array handling in PowerShell is problematic. Like, if a function returns an array, that array gets returned. Unless the array has one object, in which case it gets unrolled. Which means every time you use a function that returns an array (outside of a pipeline), you have to wrap the function in an array to ensure that later code that expects an array doesn’t fail. There are a few situations where it simplifies code a little, but in nearly every instance for me it’s just been a hassle.

1

u/surfingoldelephant 15h ago edited 14h ago

Like, if a function returns an array, that array gets returned.

No, it doesn't. Each element gets emitted individually, even if there are multiple. And the original array is lost. When there are multiple, PowerShell collects them in a new array and uses that as the result (assuming the result is being assigned to a variable).

# Each element in the int array gets emitted individually.
# PS collects them in a *new* object array. The original int array is lost.
$x = & { $a = [int[]] (1, 2, 3); $a } 
$x.GetType().Name # Object[]

When there's only one emitted object, then yes, the result is just that.

If you're the function author, Write-Output -NoEnumerate or using a throwaway array is how you guarantee array output so the caller doesn't need to wrap in an array themselves.

# Array created by the unary comma gets discarded,
# so output is the original int array.
$x = & { $a = [int[]] (1); , $a } 
$x.GetType().Name # Int32[]

Generally though, I'd avoid doing that as it breaks PS's item-by-item processing, which is the main reason for "unrolling" arrays to begin with. Functions should generally be emitting objects individually as soon as they're available and not collecting all objects upfront, so that they can participate properly in a pipeline (which is how almost every command shipped with PS behaves).

1

u/dodexahedron 15h ago edited 13h ago

There's also the -NoEnumerate switch, which is for exactly that. But using it can also be clunky.

Also, note that passing an array object through the pipeline as input to the next pipeline stage enumerates by default but, if passing that object as an explicitly named parameter (even from the pipeline), it stays an array, always.

Strongly type your parameters and write pipeline-friendly code in the first place (i.e. make use of begin, process, end, and clean as appropriate - including in ad-hoc/ in-line script blocks), and it won't be an issue.

2

u/Dry_Duck3011 23h ago

Bit of a gap in your blog! I’ve missed your posts!

3

u/KevMar Community Blogger 22h ago

Just a small gap... Thank you.

I really haven't been using PowerShell much any more because the focus of my work is different. Using PowerShell and helping others with it is what would inspire me to write about it.

2

u/MasterChiefmas 20h ago

I think the first 2 comments about running scripts and the execution policy being a security boundary are a bit iffy.

DOS/Windows is the odd one out for running things in the default folder. Macs and Linux shells all do that as well by default. If you are strictly a Windows person that's only ever used the cmd shell, then it's a fair comment to some degree. But running things in . by default is the oddity, at least by shell, not by user base. MS aligned Powershell to behave like most other shells is all.

As for changing the execution policy...it is(or can be) a security boundary. If you are in a domain environment, your ability to change the execution policy can be restricted. It's more of a conditional situation that people on other OSes or that aren't domain joined don't see.

The execution policy, to some degree least really only makes contextual sense in a Windows environment. If you don't run powershell in other environments with elevated privileges(i.e. sudo) it's not like you can bypass the security models there. Those are largely things that you can find a problem with vs other OSes because other OSes don't generally have a centralized management situation that they have to deal with. A developer in a corporate environment may find they in fact can't just change the execution policy to whatever they want.

I just feel like those are a bit of a stretch like you are actively seeking things to be annoyed about. Later on you complain about the effort to make it easier for Linux natives to use Powershell(and yeah, it's not 1-to-1 given the constraints of the nearest equivalent in PS)...so which is it, do you want it to try and behave like Linux or not?

1

u/KevMar Community Blogger 19h ago edited 17h ago

That's fair. I am still leaning on the average Windows user experience more than the specific developer experience that shouldn't be assumed to be using Windows by default anymore. My original intro was the function calling experience but I felt that stuff was universal enough that I should start with it. All of these are not my complaints so much as pain that I have seen others experience.

But I want to highlight that the Execution Policy is just a speed bump. You can't persist a change to the Execution Policy in a managed corporate environment, but you don't need to be admin to bypass it. I call out that you can specify the policy when you launch PowerShell. I don't mention that you can also change it for your current session as a user:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

And if the script you want to run is self contained, you can just copy/paste it into the terminal. It's a false sense of security at best.

Edit: I stand corrected, it can be restricted by Group Policy: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.6#use-group-policy-to-manage-execution-policy via Turn on Script Execution for all scopes without the ability to override it. If you only set MachinePolicy and UserPolicy by Group Policies without that setting, PowerShell displays an error message that the scope is set by a Group Policy if you try to change it but you can still set it for the process scope in that scenario.

1

u/MasterChiefmas 17h ago edited 17h ago

I am still leaning on the average Windows user experience more than the specific developer experience that shouldn't be assumed to be using Windows by default anymore.

Ok, if that's the case though, the title of your article is mis-matched from your target audience. You're article literally mentions devs. I don't know if it's fair to call a dev an average Windows user, though I wouldn't also assume a dev knows all the ins and outs an experienced admin would either. Although...I guess now that I think about, maybe I read the title differently then you intended. I don't know if I was an average user if I'd be overly interested in why Dev's don't like it. I'd expect a Dev that was considering or had some work coming up in PS, to be interested in it.

the execution policy stuff

I don't believe this is true if it's blocked at the domain level, but I could be wrong there. I don't have a domain I can test it on anymore.

You should get a deny error if the domain policies are being applied and enforced.

I'd be interested if someone does have a domain running they can test it for us on, if they are able to block it, probably at machine and user policy levels, if it prevents using bypass.

1

u/KevMar Community Blogger 17h ago

I found my mistake and updated my comment. You can manage it one of two ways via GPO, one of those does block it and the other just complains.

1

u/ScoobyGDSTi 18h ago

Ah no, you can absolutely enforce execution policy and prevent standard users from modifying it.

2

u/dodexahedron 15h ago

Linux has mandatory access control mechanisms, as well, and they can absolutely be applied to powershell, though of course that is orthogonal to ExecutionPolicy itself.

It's just that nobody understands them or uses those things.

Those things being SELinux, AppArmor, etc.

But yeah - the privilege models in POSIX systems, even with MAC in use, truly are extremely primitive and rudimentary in comparison to NT's model.

7

u/CaelFrost 23h ago

"Output is objects" - yes, the selling point I love as a developer. But sure, you go wild with your regex/grep.

5

u/RE20ne 18h ago

good stuff. my experience is that devs love powershell after they have spent a few weeks with it. the hate is strictly before that part.

5

u/rdldr1 18h ago

I love Powershell. It does what you tell it.

1

u/cottonycloud 21h ago

Excellent post! Touches on most of my pain points, coming from Java, C, C++, Python. PS7 has fortunately cleaned up many of my old gripes but there are still some.

- Classes and importing are a big one. There really should be only one way to import that includes classes. I cannot think of a reason why I would not to import classes as well.

- Dynamic scoping - Sorry I just don’t like it lol. If I wanted that variable, I’d have declared it as a parameter.

- Null and errors - To me, undeclared variables should always throw an exception and I shouldn’t have to toggle strict mode.

- Aside, I wish VSCode (I guess PSScriptAnalyzer) highlighted automatic variables and could discover undeclared variables.

- Null-coalescing with variables often involve enclosing the variable as such ${var}?.method(). A bit annoying for sure.

- No “using” statement to enclose variables. Just a minor gripe here.

1

u/KevMar Community Blogger 20h ago

I'm good about programming defensively against dynamic scope in my own stuff. It is so ingrained into my coding style that I forget about dynamic scope. Well ... until I run into someone else's code that abuses it.

And its not consistent in that Modules get their own scope (I think its actually a closure) and it doesn't pass it through to other Module calls. So things like -WhatIf don't consistently work when one module calls another module.

2

u/surfingoldelephant 16h ago edited 15h ago

Aside, I wish VSCode (I guess PSScriptAnalyzer) highlighted automatic variables

PSSA isn't responsible for syntax highlighting. It will however flag assignments to automatic variables by default. See AvoidAssignmentToAutomaticVariable.

Invoke-ScriptAnalyzer -ScriptDefinition '$input = 1'

# RuleName                             Severity ScriptName Line Message
# --------                             -------- ---------- ---- -------
# PSAvoidAssignmentToAutomaticVariable Warning             1    The Variable 'input' is an automatic variable that is built into
#                                                               PowerShell, assigning to it might have undesired side effects. If
#                                                               assignment is not by design, please use a different name.

Syntax highlighting comes from the TextMate grammar defined here. PS's TextMate grammar is pretty lacking, but it does actually include a rule for highlighting automatic variables. Most themes don't bother with that granularity, hence you typically end up with the same color for all variables. So you just have to configure a different color yourself. Here's the rule: support.variable.automatic.

This article explains how to do it in your VS Code settings.

1

u/cottonycloud 4h ago

Thank you! I just assumed there wasn't any option to highlight automatic variables lol.

1

u/scrumbud 20h ago

Good write up. I've been using powershell for years, and didn't know about the comparison operators functioning as filters.

1

u/KevMar Community Blogger 20h ago

It might be worth revisiting my "Everything you wanted to know" posts where I do the deepest of dives into the most basic of things in PowerShell.

2,200 words on the switch statement sounds like a lot, but did you know the PowerShell switch is a loop that can have multiple cases regex match each line of text read directly from a file? Everything you ever wanted to know about the switch statement.

1

u/PinchesTheCrab 1d ago edited 23h ago

My biggest issue is the I have to do everything myself because of the lack of security tooling for PWSH compared to other languages.

When I download java libraries I can use a proxy that scans them for vulnerabilities. I can look at a version history with known vulnerabilities and scan results. With all the vulnerabilities AI has discovered lately we have daily standups to discuss security scan results and establish remediation deadlines.

There's no equivalent for PWSH. I host a nuget feed in our repository where I can publish modules and proxy the psgallery, but no security scans are happening on the random third party modules users are installing. It's the wild west, and I think we're one major incident away from cutting off external module downloads entirely.

PWSH lives between scripting and programming and I love it, but it's definitely not a first class citizen among programming languages.

1

u/KevMar Community Blogger 23h ago

Yes, PowerShell package management in general leaves a lot to be desired.

1

u/PinchesTheCrab 22h ago

It's not just that though, there's various apps that scan our code for various coding vulnerabilities we've written, like passing unsanitized user input to another command.

1

u/BlackV 20h ago

I think that's where they're going with the "new" PowerShell gallery being based on the azure container registry

MS will have their own registry where all ms things go (signed and vetted), psgalery will stay the wild wild west, all the OEMs will create their own (hpe, VMware, etc)

1

u/neotearoa 19h ago

Kevin, I'm a genius dumbass. I've failed up in it my entire career; held back by crippling ADHD and boosted by methylphenidate and the late age diagnosis chip on both shoulders. I'm currently squashing 50 pounds of shit into a 40 pound bag using AI and so so many times have I been stung by the fact that llms have been trained on not powershell.

That section alone was almost more significant than the article in its entirety for me.

As I read each paragraph, I chuckled a little thinking yup, been bitten by that before when writing pre AI.

Then quietly another more recent and less decipherable feeling of familiarity arose that was immediately unlocked at the training paragraph.

Cheers from the top of the world, in the best, least drawn country you know.

1

u/KevMar Community Blogger 16h ago

Thank you. It was the realization that AI was making these same mistakes that pushed me to finally write this post.

0

u/neotearoa 16h ago

Kevin, ngl, I felt smart when the penny dropped. My suspicions were correct but my knowledge was lacking. So thank you. I immediately turned the page into a skill and have been using it since.

This is for a personal project to help me bridge the gap between my chemical disadvantage and my persistent refusal to be bound by it.

I'll still die as dumb as I was born, but you know I'll be just that much happier for this.

Chur.

1

u/alconaft43 23h ago

I would keep away devs from using powershell to deploy their products.

1

u/AGsec 21h ago

This is great for non developer too. I am really trying to internalize "The PowerShell way" and this is a good reference to not only understand "the way", but see how it's done in the developer world and why. One of the harder things about PowerShell is that a PowerShell power user can be very different from most other power scripters and developers, so this article serves as a handy cheat sheet that bridges the gap when talking with others who are not PowerShell centric.

1

u/McWormy 20h ago

Depends what you mean by developing. I certainly wouldn’t use it as a dev tool.

Administration, yes.

1

u/wonkifier 17h ago

One other one that has eaten so much of my time over the years until I figured out how to make it work

Adding an index entry to a list. This one works:

GOOD:

 $i=1;Get-ChildItem | Select-Object @{Name="index"; Expression={($script:i++)}}, Name, PSIsContainer, Length

Note the () around the increment

--

Without that, the index is empty.

BAD:

$i=1; Get-ChildItem | Select-Object @{Name="index"; Expression={$script:i++}}, Name, PSIsContainer, Length

--

Similarly, without the scoping, it doesn't work either, even with the parens. This just shows "1" for each row

BAD:

$i=1; Get-ChildItem | Select-Object @{Name="index"; Expression={($i++)}}, Name, PSIsContainer, Length

--

Remove them both, and you're back to empty

BAD:

$i=1; Get-ChildItem | Select-Object @{Name="index"; Expression={($i++}}, Name, PSIsContainer, Length

--

It's extremely unintuitive

1

u/Contao 8h ago

This is $true

1

u/smallestworry 1h ago

This explains why I hate powershell even though I really really need it. So happy to have Claude to write it for me, saves hours of stupid syntax debugging.

1

u/chrisdrobison 52m ago

Powershell definitely has its eccentricities for sure. But, as a developer, PS is often my go-to because it is a full programming language in a scripting language and to me that is huge. Every time I use something like Bash, I forget it is mostly just an orchestrator of running different processes to get things done--which is fine, but it's a total pain when I do actually need something more complex.

1

u/Aecnoril 29m ago

Funny, currently building a WPF app to automate Active Directory processes through a Powershell Command builder. And I can recognize some of these struggles I had when I first went to powershell. Luckily that's all way behind me now.

-6

u/Medium-Comfortable 23h ago

ls exists, but it isn’t the ls you know.

That's where I stopped reading. No shit Sherlock, a different script language behaves differently.

6

u/KevMar Community Blogger 23h ago

Yes, I do point out some obvious things in a post about people making assumption. I generally start overly basic before diving into more challenging things.

7

u/aguerooo_9320 23h ago

This is Kevin Marquette, he's aware of it all, just explaining from the point of view of a developer.

1

u/chrono13 22h ago edited 22h ago

But that's not the command. The command is Get-ChildItem. GCI has expected behavior. LS in powershell does not have the expected behavior in its output or flags.

This is an alias, but an alias that doesn't take the ls flags. Which means despite being cross-platform, And the command existing on both systems, it breaks depending on which operating system it's ran on. A better example is how this aliasing breaks the expected behavior of curl.

To put it another way, if I were to simply list the contents of a folder as the only command in powershell with a single flag, and it's working on Linux, BSD and Mac, it will break on Windows. That's not expected behavior for a cross platform scripting language.

1

u/BlackV 20h ago

Medium-Comfortable

ls exists, but it isn’t the ls you know.

That's where I stopped reading. No shit Sherlock, a different script language behaves differently.

Sounds like maybe you should have read more then, sounds like that was exactly the point they were making....

1

u/neotearoa 19h ago

Bruh, this is nature or evolution at play. Be a gentle god and let it work itself out 🙏.

Remember that you can lead a horticulture, but you can not make it think.

1

u/BlackV 18h ago

Ha, can do

-2

u/VirtualDenzel 23h ago

Its just that paupershell (as we call it) likes to make its own rules. Has documentation that does not get updated. Graph changes weekly and is a mess.

Sure its handy to do some with powershell cmdlets. Ht for windows cmd.exe was just as good.

Compared to almost all other languages i ever coded in is paupershell a joke.

4

u/KevMar Community Blogger 23h ago

It absolutely makes its own rules. It was also for an audience all the other languages didn't serve very well.

-1

u/Dave_A480 16h ago

Because the whole idea of an object oriented CLI scripting language is nuts.... And if you really want that there is Python (but you're a sadist)....

The Unix CLI (simplified to bash, although ksh or any of the Bourne variants fits) is much simpler, has more powerful text processing functions, and aside from some historical curiosities (ls instead of list because 2 bytes better than 4) overall makes more sense....

That said, it's a better way to interact with VMWare than the pointyclicky web interface, for interactive administration tasks (Ansible is better for automated/repetitive ones).....

And the best way to interact with Windows Servers for interactive administration

0

u/Szeraax 17h ago

This is a very good writeup, KevMar. You correctly hit some of the big pain points with classes.

If we were still in 2022, I'd probably yell about you not griping about method chaining on the annoyances for developers trying to use classes. :P But in 2026 where AI is writing a lot of the code, its just as easy to let the AI write the code with all the needed methods fully flushed out.

-2

u/anarchyusa 20h ago

I think PowerShell really was broken out of the gate with it’s Verb-Noun i.e putting the method before the object then supplying other methods downstream. That’s not an opinion or just a product of habituation. Keeping to one hierarchy is objectively better from an objective, neurological standpoint.

-6

u/JoelyMalookey 19h ago

Terrible article nitpicking 101 stuff?? Consisting it can use any .net library it’s just a bad take article