Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Powershell is underrated and I actually prefer it over bash but indeed the syntax can be a slog sometimes. I used it a lot but I never felt I was “fluent” and found myself usually often needing the docs for even basic syntax (for loop, function params, etc.) Also in my experience I found some of the limitations surprising, having to call .NET methods was not uncommon for me. Regardless I’m happy to never write a batch script for the rest of my life, powershell is definitely an upgrade.


I really do not see powershell as a bash, zsh, fish, ... shell equivalent. It is more inline with perl, python, php, ... scripting languages. One thing I really dislike about powershell development is default aliasing such as using curl to actually call Invoke-WebRequest. This was such bad taste and disrespectful to the actual application and their developers that make a really good library and tool. Windows even now comes with curl.exe in C:\Windows\System32.


> One thing I really dislike about powershell development is default aliasing such as using curl to actually call Invoke-WebRequest.

Hasn't been a thing for a while now.


While it's true that it's no longer aliased in PowerShell 7, the currently shipping version of Windows PowerShell included in Windows 11 still aliases it to this day. If you intend to be portable across both versions, you still have to use "curl.exe" to get the real curl.


My main use for llms has been to finally start making power shell scripts


Heh, so much so. I'll have gpt make a series of loops and evaluators and then come back and put the my logic in the placeholders.

The other thing I find is by thinking out the process of what I need and communicating to the LLM is I tend to make better scripts that have more functionality since I'm thinking about what I want done, and not thinking about just getting the syntax correct.


It is great for doing something like 'write a script that recursively goes through all the directories and finds pictures which were taken between <date> and <date> and copy them to <directory> then sort them in subdirectories by month and day.'

So much tedium is now easy if I can remember 'powershell can do it, and GPT can write it for me'.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: