views:

8076

answers:

9

I would like to learn PowerShell in my spare time.

I already know a bunch of stuff in that line (Perl, Ruby, Python, bash, cmd.exe) so a tutorial leveraging that would be awesome.

Also, since I am a software developer (C# mainly, but done some C, some C++, some Java etc.) I am looking for something not geared towards the usual "power user", but toward someone who actually enjoys reading (and writing) EBNFs!

Do you know of any such tutorial / introductory reading?

+1  A: 

http://powershell.com/ perhaps, run by a powershell MVP

Chris S
+2  A: 

Your best move might be to try to unlearn some of what you know about shell scripting from the unix world. When I've tried to use PowerShell to do stuff I would normally use unix-like tools to do I've always ended up with really inefficent solutions. I suspect it's because I try to take too much of my *nix ways with me.

Yeah, of course you can't unlearn. But I think PowerShell needs an approach that targets its strengths. The PowerShell Tao. Find a tutorial pointing at that and you should have better success than mine.

PEZ
Are you talking about awk-style extracting of information from text which is typically not necessary in PS, or are there other UNIX habits to unlearn?
Wim Coenen
Stuff like that. Unix is very text oriented. I might have been unlucky with my attempts. But everything I tried I could always make it run 100 times faster using Cygwin.
PEZ
+3  A: 

I'm still learning PowerShell (at a snail's pace) myself, so I can't really offer up a one-stop tutorial. However, I can provide you with collection of links I've been building for the past few months. Be forewarned - I'm a DBA, so some of them have a slant in that direction.

http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx - Microsoft Scripting Center for PowerShell

http://www.mindofroot.com/2008/11/19/mapping-ad-group-relationships-with-powershell/

http://sqlblog.com/blogs/lara_rubbelke/default.aspx - Lara Rubbelke does a lot with SQL SMO and PowerShell

http://blogs.msdn.com/buckwoody/ - Buck Woody has tons of PowerShell stuff, and specifically in November of 2008, after the PASS conference, he posted a great framework: http://blogs.msdn.com/buckwoody/archive/2008/11/21/pass-2008-conference-day-five.aspx

Again - sorry I can't be a little more specific, but maybe this can be a bit of a building block, too.

ILKirk
+6  A: 

PowerShell in Action (http://www.manning.com/payette) was written by Bruce Payette, PowerShell's language designer. His book is excellent as it explains why they made a lot of the decisions they did, not just explaining the "what."

My learning experience went thusly: downloaded PowerShell=>read first 5 or so chapters of book=>built script, using book as reference.

If you're considering buying the book direct from Manning, look around for Manning coupons; I vaguely remember there's a 50% off coupon available now.

Peter Seale
+3  A: 

Not tutorials, but some things you may want to check/consider: A video on converting C# to PowerShell v2: http://powershell.com/cs/media/p/133.aspx

Some challenges with solutions: http://www.microsoft.com/technet/scriptcenter/funzone/games/default.mspx

You're C# experience will definitely help you to quickly grasp using objects in PowerShell.

Marco Shaw
+13  A: 

I liked these two books:

Also, check out these sites:

aphoria
Great answer, this really helped me.
Lucas McCoy
+1  A: 

I got started using the tutorial on PowerShell Pro.

My only complaints are:

  • The navigation is hard to use (list of links on the right hand side)
  • There are a few errors and typos throughout. Although if you're an astute reader, you'll notice right away.

The teaching techniques I found useful were when they show how to do a task in both PowerShell and through regular Windows GUI (like MMC) and when they describe real-world uses for some of the scripts or commands.

T Pops
+2  A: 

See also Master-PowerShell | With Dr. Tobias Weltner, a "free e-book from the makers of PowerShell Plus", recommended by Jeffrey Snover - note that this book deals with PowerShell v1.

Dan Blanchard
+1  A: 

PwrShell.net (the codecorner) good for beginners. Stuff like working with arrays and basic things. Really great to start with!

juFo