I recently ran across PSReadLine, a project that makes the PowerShell console act more like a bash shell. I’ve just started using it, but it seems promising. I’m switching between Linux and Windows frequently these days and it’s nice to have a little more in common between the two.
I’d rather write a PowerShell script than a bash script, but I’d rather use the bash console interactively. The PowerShell console is essentially the old cmd.exe
console. (I haven’t kept up with PowerShell in a while, so maybe there have been some improvements, but it’s my impression that the scripting language has moved forward and the console has not.) PSReadLine adds some bash-like console conveniences such as Emacs-like editing at the command prompt.
Update: Thanks to Will for pointing out Clink in the comments. Clink sounds like it may be even better than PSReadLine.
I use clink to get some semblance of a sensible windows command prompt. It brings proper bash style readline and tab completion to the basic windows shell.
It is usable in PowerShell too.
When I’m in the PowerShell mood, I tend to use the PowerShell ISE (powershell_ise.exe). A bit heavier to load, but has nice popup-style completion boxes, fancy searchable list of commands, integrated editor if you’re authoring scripts.
Few people notice meaningful differences between PSReadline and clink – compatibility is very good and I fix issues that are reported. PSReadline also have some PowerShell specific features that make it better than clink for PowerShell.
The Clink web site says that the latest version of Clink works with PowerShell, but the features I tried did not work when I launched PowerShell from cmd.exe. (Maybe there’s another way you’re supposed to use Clink with PowerShell?) However, so far Clink has worked flawlessly with cmd.exe.
If you like bash, why not use bash everywhere?
I use Cygwin’s bash, but there are other bashisms out there.
-BobC
@BobC Cygwin and bash are really do not really work that well in MS Windows. Powershell is much better integrated, though the command line is still not that good.
I started learning with the Powershell ISE, but ended up using the free Idera Powershell Plus tool. It’s a full featured ISE and comes with a good starter library for those just learning Powershell. Another good tool that I use is UltraEdit, which is a shareware ISE that is configurable for just about any scripting environment.