views:

196

answers:

4

For someone who has been using bash for years, what's the quickest way to get productive with Microsoft's PowerShell? I've noticed my old friends ls and ps work, but sadly grep didn't. I could just man up and read through the piles of documentation, but I'm guessing there is a quicker path to productivity for someone with a long history of bash usage.

I don't know if it matters or not, but the reason I'm looking to get acquainted is because it seems like there is finally a proper shell on Windows instead of needing to install cygwin, and I'd like to start using it exclusively instead of writing bat files for automated activities like builds and deployments and such.

+6  A: 

I'd suggest just man up and read through the "piles" of documentation. It's actually not that difficult once you get the basics down. You'll need the knowledge anyway if you intend to do anything even remotely productive with PowerShell.

David Brown
+ 1 for the sheer irony of saying "man up" in your answer considering question title
ChssPly76
I'm feeling so manly now
slf
I'm considering editing the title to say "Bash(ful)" even though it ruins the existing reference. Nah, I'll leave it alone.
Dennis Williamson
+4  A: 

A quick Cheat sheet

mjv
3 cheers for select-string
slf
+7  A: 

I'm not sure your Bash history is going to help you much with PowerShell. It is quite a bit different since the idea is to pipeline rich .NET objects as opposed to text or byte streams. For a leg up, check out my Effective PowerShell free eBook. It is about 60 pages but I think does a decent job of outlining the mental model you need to get the most out of PowerShell. For a full, free book check out Master PowerShell. At the point you think you're willing to part with some $$, Windows PowerShell in Action is the best book out there IMO.

Note: there are some "Unix" oriented aliases to get you by for a while (ls, ps, etc) but you'll run out of steam pretty quick because the parameters are quite different and as I said the pipeline is quite different than in Bash.

I would also recommended looking over some of the Q&A on PowerShell on StackOverflow especially for those questions that you think - "yeah, how would you do that in PowerShell". I think you would learn a good bit just doing that.

Keith Hill
A: 

there GNU utilities such as your favourite grep that is ported to windows. see GNU packages

on the other hand, if you loathe the idea of downloading stuff, you can use vbscript. it comes natively installed.

ghostdog74
i am suggesting 2 alternatives.. besides vbscript is just as powerful and easy to use and it comes natively. another downgrade for no reason. WTH
ghostdog74
slipsec
you are also forgetting the fact that there are also older version of windows lying around.
ghostdog74