Chocolatey - Windows Package Manager
chocolatey.org
chocolatey.org
DownloadString("http://bit.ly/psChocInstall"))
I don't think that is the best idea ever had...RVM:
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
Homebrew: /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"If you use the "append a +" bit.ly feature, you can check where it ends up, but not everybody knows to do that. https://bitly.com/psChocInstall+
2) .com isn't as potentially susceptible as a Libyan tld.
3) They are relying on bit.ly to serve the correct file.
Can't find the discussion, but there is certainly a fairly large body of people who oppose those examples as well.
iex ((new-object net.webclient).DownloadString("http://bit.ly/psChocInstall"))And yeah I realize you can come up with an ugly command line example in just about anything. But powershell tends to be one of the uglier ones out there.
wget http://bit.ly/psChocInstall
vs ((new-object net.webclient).DownloadString("http://bit.ly/psChocInstall"))But, with wget, the line is
iex (wget -qO- http://bit.ly/psChocInstall)
which isn't too bad.Chocolatey will probably get more users early on though, because of its association with the ever-popular NuGet (watch for the Scott Hanselman blog post...).
You can see how easy it is to create a package here: https://github.com/chocolatey/chocolatey/wiki/CreatePackages
And you also get easy integration with the .NET libraries.
As a sysadmin I use powershell for quite a few automation and management tasks on Windows servers. It is nice to have a interface to the server that I know will always be on the server and will update by itself. There is no need to install a third party scripting language just to script simple things that are difficult to do in the standard windows command line.
ls -r | ?{$_.Length > 100*1024}
Doing this in Bash or CMD would be annoying (certainly doable though!), especially the recursive part. find . -size +100kOf course, that form in Unix would not be suggested, because there are other far better (readable/concise) ways of doing that. (like the 'find' one someone else just gave you).
PowerShell vs cmd.exe PowerShell is actually a complete shell scripting language, that gives you full access to all of the .NET libraries and methods. It also has a rather nice IDE that ships with Windows as is. Also, you can use PShell of Exchange and other server automation, you can do remote scripting, and it has some pretty decent security controls baked into the system.
If this is going to be a "shell" replacement it needs to start very fast at least in hot mode (cached).
Which is IMHO the best part about unix shell and the worst about PowerShell: being pure text, unix shell allows for very loose definition of the interface between the program and outside, allowing to connect stuff in creative ways with minimal plumbing; whereas PowerShell makes this interface definition quite stringent by comparison, hence needing theoretically less plumbing (at least for simple tasks) but requiring far more design in the interface, restricting connectivity which in turns generates more mediation and plumbing to connect foreign elements.
In short unix shell may seem archaic but its loose binding makes it very powerful and quick to solve problems, while PowerShell is, well, a chore.
I wonder how far you could get by sort of plopping PowerShell onto the Unix shell and supporting both structured and text data.
(Incidentally, one such corner case is summing a list of numbers - this sounds like it should be a short command, but actually requires a complicated command line using awk.)