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

It's not the most succinct language I'll give it that.




But it is readable, which is much more important.

Even someone who has never seen a Windows PC in their life could guess what this script does.

Linux and Unix shell commands use completely arbitrary single letter parameters that must be looked up or memorised. That’s not a virtue.


Not to mention, everything-is-an-object is a much better experience than text only.

I wouldn’t mind a shell that uses structured text, such as JSON, but the inefficiency of the parsing and serialisation makes my eye twitch.

PowerShell does provide a ConvertTo-Json [0] for those who need it.

[0]: https://learn.microsoft.com/en-us/powershell/module/microsof...

Contrary to how it sounds I actually like PowerShell as a scripting language in itself. A lot of its ideas are pretty clever.

I treat my dormant familiarity with it as a resume hedge. Ideally things in my life continue to go well, and I can keep climbing the ranks of doing more and more impressive things powered by the Unix systems I've been daily driving since I was 14. If, however, things in my life ever go truly sideways, I could probably dial it way back and eke out an existence at some low pay, low stress, fully remote Windows admin job at some dinosaur of a company somewhere. There I could use PS and its deep, deep integration with all things Windows to automate 90-99% of it away, so that I could spend my time e.g. tending to my young children instead. (Even if Copy-Item is 27% slower than drag and drop. My time is still more expensive than the machine's.)

I truly never hope that has to happen, of course.


Copy-Item is a cmdlet, the native way to do it in PowerShell. Gp posted a hack to replicate the GUI in PowerShell.

Because as TFA reported, Copy-Item is much slower than the GUI.



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

Search: