Hacker News new | past | comments | ask | show | jobs | submit login

I dunno, I'm a long term *NIX person (Solaris 1994-2011, Linux on and off 1994-2006, Linux mostly 2006-now) I am now involved in more Powershell scripting on Windows than I have ever done before. I don't see - Get-Content -Tail 10 FILE as an improvement on - tail -10 FILE

I think when it comes to the combination of intuitive command names and terseness when required, VMS' DCL is still unsurpassed. Having commands with sensible names that can the be shortened and a really useable HELP system was a major plus and I've not seen anything match that since.




To me, the main advantage of Powershell is filename handling.

I know that if I do everything just right, then my scripts will handle filenames with spaces/newlines/other crazy characters, but I always mess up somehow. Nowadays if I ever want a script I'll distribute to people who might have spaces in directories, I write it in python even if it would be a 4 line bash script, just to avoid the issue.


I've never really had a problem with spaces in path names.

You should be quoting variables when they're used though, there is a shell style guide put out by google that deals with this stuff.

https://google.github.io/styleguide/shell.xml?showone=Quotin...


Well, once you know that PowerShell uses the verb "Get" for fetching data, and the noun "Content" for file contents then those are reusable bits of knowledge that slot together with other verbs and nouns. It's easy to hold in your head and build your knowledge over time, and better yet, the third-party add-ons obey the common conventions, so you can experiment with confidence.

When you learn the *NIX command-line from scratch, everything is special cases, so the whole experience is peering at man pages and slowly rote-learning commands and options. The only commonality is that if you try to guess, you'll probably be wrong. My patience with the philosophy of independent tools hit breaking point a while ago, when I had to start learning the different CLI tools from rival cloud providers - so much to learn, and no consistency at all.


I think this is one of those "familiarity" and "expectation" issues that are very subjective. Rather like python's divisive significant whitespace.

I've tried to like powershell, but when I wanted "grep" I ended up having to do:

Select-String "str" -Path foo.txt | ForEach-Object { Write-Output $_.Line } | Out-File t.txt

.. because it has broken defaults such as truncating output to terminal width even when written to a file.

Then there's the weirdness around enabling script execution (rather more complicated than +x) and the remote execution system is much stranger than ssh.


My first brushes with PowerShell were deeply frustrating, because I kept trying to write things the way that I expected them to work (from Bash). After a while I gave in and sat through a tutorial, and found that once I did things the way PowerShell wanted, I found it enjoyable to work with. That's just my personal experience.

FWIW, the script execution thing was dropped for the latest versions of Windows, and PowerShell Core (thankfully). I agree that the remoting is not much fun - SSH for Windows is currently due in October, so I presume that PowerShell will get SSH support around then.


> I dunno, I'm a long term NIX person (Solaris 1994-2011, Linux on and off 1994-2006, Linux mostly 2006-now)

But I think this is the point. PowerShell (or the spirit of it) would be more useful for new users because they don't need to spend time memorizing every single command and can start being productive earlier. It probably makes less of a difference if the commands are already part of your muscle memory.

Though to be fair, CMD is a lot more quirky and inconsistent than modern bash. So before the advent of PowerShell, I think you could have made the same argument on favor of ...nix and against windows.




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

Search: