r/PowerShell • Community Blogger • 10d 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

430 Upvotes

115 comments sorted by

View all comments

1

u/chocolateAbuser 6d ago

the issue is rules are not simple, this doesn't work if you have to use it those two times a years you need to do a """""simple"""" script to loop something, too many weirdnesses and random wtfs; i guess the first is the output discard, when i saw that it immediately burn into my neurons as one of the biggest wtf and i'll never forget it, the other thing is string templates, which sacred combination of symbols and punctuation to use to print a string with a variabile in it... it takes at least 10 tries, the i give up an ask ai to do it

2

u/Nu11u5 5d ago edited 5d ago

I quickly learned to stop treating the "output" stream as text output and only use it for pipeline data. Instead I use any of the alternative streams like Write-Information, Write-Verbose, Write-Warning, and Write-Debug. Write-Host even has its uses though it is discouraged. Though I don't understand why the Information stream is disabled by default.

1

u/chocolateAbuser 5d ago

since when write-host is discouraged? i've never heard of that

2

u/Nu11u5 5d ago edited 5d ago

The original implementation of Write-Host bypassed PowerShell's stream and pipeline handling, meaning it could not be captured or redirected by higher-level scopes. Microsoft discouraged its use and created a PSScriptAnalyzer rule for it:

https://learn.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/rules/avoidusingwritehost?view=ps-modules

Starting with PowerShell v5, Write-Host is now just a wrapper for Write-Information (output stream 6) with an implicit -InformationAction 'Continue' parameter. You can use it, but it's just a shorthand for Write-Information. I guess it's personal choice anymore, but I like the logic of using different logging level streams.

1

u/KevMar Community Blogger 6d ago

I should do a post on the pipeline. Truly understanding how to lean in on that explains some of the weirdness.

$report = foreach($user in $userList){
    'Name: {0}, {1}' -f $user.last, $user.first
}

And there are so many ways to substitute variables: https://powershellexplained.com/2017-01-13-powershell-variable-substitution-in-strings/

But you capture the point of the article well. You have certain intuitions that conflict with PowerShell's design philosophy.

2

u/chocolateAbuser 5d ago

i mean powershell brings the power of an entire programming language into the shell, which is cool but the mixture result it a tad complex
if you really need a simple interaction this is overkill, which i guess is kinda the point