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

I've spent quite a bit of time recently with PowerShell and I have to say that at best, I'm underwhelmed. I can see the potential with PS but there are too many things that are just left out by default.

The documentation seems incomplete and very clunky to actually use; it's hard to find what command you want and some docs are just plain wrong. Even using third party docs is frustrating. Honestly, it reminds me of the PHP docs, and not in a good way. Job control seems to be very clunky. I can't seem to push things into the background reliably in a PS1 script. Some things seem to work OK but others just background and disappear. Another problem I've had is appending to files; you can output log information to a file (ie. ls > ls.log) but you can't append to a log file (ie. ls >> ls.log). There may be a way to do it, but it probably involves writing a command and loading it somewhere.

That's the most annoying thing I find when living in the Windows world; there doesn't seem to be a good representation of $HOME. Where do I keep my SSH keys? When I create PS1 scriptlets how do I ensure they are loaded in a new PS1 shell? I'm sure there are answers to this but, as I said before, the docs are not the best. Maybe Microsoft should author a BASH --> PS1 translation guide. :)



To your second point, @home is a default variable $home and can be de-reffed from '~':

PS C:\Users\rich> ls ~/.ssh

    Directory: C:\Users\rich\.ssh

Mode LastWriteTime Length Name

---- ------------- ------ ----

-a---- 1/14/2016 19:30 3247 id_rsa

-a---- 1/14/2016 19:30 744 id_rsa.pub

-a---- 1/14/2016 22:12 1595 known_hosts


I think you're suffering from PEBCAC ;)

You can append content to a file using >>:

PS C:\Users\rich> "Foo" > 1.txt

PS C:\Users\rich> cat .\1.txt

Foo

PS C:\Users\rich> "Bar" >> 1.txt

PS C:\Users\rich> cat .\1.txt

Foo

Bar




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

Search: