News for hackers. Stuff that matters.
Re:PowerShell Specification licensed under the Community Pro... by code_duck on Sunday May 08, 2011 @06:38PM (#2526876)
I've heard a lot of good things about it, mainly from people used to CMD though. When I checked it out, I didn't find a lot to do with it. I didn't feel like learning a new shell language that only works on Windows. The lack of familiar helper tools such as diff, grep and sed didn't help, and I don't know whatever Windows equivalents may exist. I'm sure if I was using Windows PWSH would be great, but like many of us I don't have any interest in using Windows as a webserver platform.

Now that there may be a prospect of using PowerShell on other platforms, I wonder why I'd bother? Day to day tasks I'm perfectly happy doing in bash, and anything more complex, I'd just as soon use Python, Ruby, PHP or Perl.

Re:PowerShell Specification licensed under the Community Pro... by seabee on Monday May 09, 2011 @01:46AM (#2527692)
grep is Select-String

diff is an alias for Compare-Object so if you tried it, you should have seen it do something. But unlike actual diff it operates on objects rather than files, so you need to gc (Get-Content) the files you want to compare.

sed/awk: string manipulation is built-in to PowerShell, but sed's in-place file editing is replicated by piping Get-Content into Set-Content. Sometimes more verbose, sometimes not.

I personally don't see what value PowerShell would bring to other platforms, given they already have huge swathes of scripts written in well-developed (or at least well-discussed) languages and command-line tools for system administration are plentiful. But why would you bother using Perl when you already have Ruby? Obviously some people will take the choice if they know it.