4 ms·
I use Powershell daily on novice level (shell only, no scripts). There are some nice things compared to bash, like tab completion on program arguments. However
by fetbaffe 7y ago
I use Powershell daily on novice level (shell only, no scripts).
There are some nice things compared to bash, like tab completion on program arguments. However it is somewhat slow.
What surprises me is that somethings are just awkward & cumbersome, like excluding multiple folders when doing Get-ChildItem.
https://stackoverflow.com/questions/15294836/how-can-i-exclude-multiple-folders-using-get-childitem-exclude https://stackoverflow.com/questions/15294836/how-can-i-exclu...
Or escaping arguments with correct quoting. Sometimes I can't get it to work, like searching for strings with weird characters, especially if I need to combine it with git grep.
- JensRex 7y ago>tab completion on program arguments Bash has that as well. This thread is full of praise for PowerShell, but every time I've tried to use it, I've become annoyed with it. For example, to get the size of a folder in Bash, I'd type `du -sh <folder>`. In PowerShell it's some absurd code spaghetti that someone put in a Github repo [1]. No matter what I try to do in PS, I find the syntax ridiculously verbose. Maybe I just don't get it, whatever it is. \shrug\ [1] https://github.com/gngrninja/PSFolderSize https://github.com/gngrninja/PSFolderSize
- flukus 7y agoThis is my experience too, anything non-trivial quickly becomes an absolute mess, even the trivial things often have bad defaults. A few years ago I looked into using it as a build system for .net projects but ended up tearing my hair out on even the simplest things like removing directories or recursively copying html files: http://flukus.github.io/powershell-is-a-joke.html http://flukus.github.io/powershell-is-a-joke.html
- CuriousSkeptic 7y agoIf you do find yourself in this spot. Have a look at Invoke-Build. It adds some sanity to such scripts, to the point of almost being enjoyable. Edit: (I only use it to orchestrate and combine other build systems though)
- nickcox 7y agoNot sure that's a fair comparison though. `du` isn't built in to bash, afaik; you could just as easily type `du -sh <folder>` in PowerShell. If you /did/ need to do it without `du` then it would be something like: `dir <folder> -Recurse | measure -Property Length -Sum` which is easier to remember than whatever the equivalent bash would be, imo.
- JensRex 7y ago>Not sure that's a fair comparison though Maybe not in a technical sense, but I've never encountered Bash without GNU coreutils (or busybox). I'm just comparing how I would solve a problem in a typical *nix environment, compared to a Windows environment.