views:

3400

answers:

11

I played with one of the early beta's of Powershell V1, but haven't used it since it went "gold". What is the best way to get started using Powershell? Which version of Powershell should I be using (V1.0 vs 2.0 CTP's)? What are you using Powershell for? Are there any tools that make using Powershell easier (i.e. development environments)?

+15  A: 

There are a number of Powershell tools, eg.

PowerGUI - http://powergui.org/index.jspa

PowerShell Plus (not free) - http://www.powershellplus.com/

PowerShell in Action is a well regarded book.

And the Powershell team has a blog: http://blogs.msdn.com/powershell/

Kevin Dente
Voting up for _PowerShell in Action_ (or is it _PowerShell Inaction_?), it's very good. _Windows PowerShell Cookbook_ is also a good one to have, coming at the problem from a very different angle.
Jay Bazuzi
+2  A: 

Check PowerGUI, a PowerShell GUI and script editor. I don't use it yet, but I saw the sample videos and looks very good. Also, the site mantains a library with sample scripts.

Here is another excellent PowerShell reference.

PabloG
+5  A: 

Count me in with a vote for PowerShell in Action. There are a bunch of blogs out there as well, check out /\/\O\/\/'s blog, The Huddled Masses, and JB's Powershell(sql) as well, they go way back w/ the shell and have gobs of good scripts & snippets to look at.

slipsec
A: 

There are DNRtvs on Powershell and PowerGUI, there are also .Net Rocks! episodes about these tools.

Eric Haskins
+25  A: 

For learning PowerShell, there are a number of great resources

  1. Technet Virtual Labs (Introduction to Windows PowerShell and Writing Scripts with Windows PowerShell)
  2. PowerShellCommunity.org - Forums, blogs, script repository
  3. #powershell on irc.freenode.net
  4. PowerShell podcasts - PowerScripting.net and Get-Scripting.blogspot.com

For IDE style environments, you have PowerShell Analyzer (free) and PowerGUI (free), PowerShell Plus (commercial), PrimalScript (commercial), and Admin Script Editor (commerical).

I use PowerShell for everything that I can. Right now, I'm looking at Psake, a PowerShell based build script environment. I use if for managing my Active Directory, Hyper-V, Twitter, some keyboard automation (hosting PowerShell in a winforms app to grab keystrokes), and a ton of other stuff. Another cool project I have to check out is PSExpect for testing. I also use it for database access - monitoring changes made to rows in a database by applications. It is also integrated in to my network monitoring solution.

I am also looking to use PowerShell as a scripting engine for a project I am working on.

EDIT: If you are just learning PowerShell, I would focus on V1. As you get more comfortable, take a look at the CTP, but too much can change from the CTP to what is actually released as V2 to make that your learning tool. Version 2 is out and available from XP SP3, Server 2003, Vista, and Server 2008 and in the box for Win7 and Server 2008 R2. What you learned for V1 will still serve you well, but now I would concentrate on V2, as there is a superior feature set.

Good luck!

Steven Murawski
As far as I understand, V1 is more of a developer-oriented release while V2 is more IT-oriented in a way that for V2, people do not have to get their hands dirty by opening up Visual Studio to create more complex cmdlets.
Sung Meister
@Sung V1 is just that, the first release. The idea behind PowerShell has always been to surface commands in a task-oriented way. V2 does make extending functionality much easier for admins with advanced functions.
Steven Murawski
@Sung I expect to see even better things with each release! :)
Steven Murawski
As an update to tag the top-voted answer -- V2 was stealth-released at the end of October '09 as part of the Windows Management Framework Core (for XP and all later OS versions) -- http://support.microsoft.com/kb/968929
Steve Gilham
+2  A: 

The Ars Technica tutorial is a bit dated, but very good to get you up-and-running with PowerShell.

I would also second the suggestion to check out PowerGUI.

jerhinesmith
+12  A: 

To answer your questions one by one.

Get v2.0 of the CTP. I have used 1.0 and 2.0 and have not found any stability issues with the later version and it has more functionality.

The best way to get started is to learn three basic commands and start playing with it.

Step 1 - Discover the available commands using Get-Command

To find all of the "get" commands, for example, you just type:

Get-Command get*

To find all of the "set" commands, for example, you just type:

Get-Command set*

Step 2 - Learn how to use each command using Get-Help

To get basic help about the Get-Command commandlet type:

Get-Help Get-Command

To get more information type:

Get-Help Get-Command -full

Step 3 - Discover object properties and methods using Get-Member

Powershell is an object oriented scripting language. Everything is a fully fledged .Net object with properties and methods.

For example to get the properties and methods on the object emitted by the Get-Process commandlet type:

Get-Process | Get-Member

There are a few other concepts that you need to understand like pipes and regular expressions, but those should already be familiar if you have already done some scripting.

What am I using it for?

Two things:

  1. Processing log files from a massively distributed grid application. For this it has proven to be incredibly valuable and powerful.
  2. Quick testing of .Net classes.
John Channing
A: 

A chap called Guy Thomas does some good introductions to powershell.

http://computerperformance.co.uk/ezine/

Tubs
+1  A: 

The PowerShell CTP is NOT supported in a production environment and a lot will change between now and the time it ships. I suggest following the many PowerShell blogs (don't forget the PowerScripting podcast). There's no shortage of good books on the topic. If you want to spend a little money, SAPIEN Technologies has some self-paced learning material at www.scriptingoutpost.com. I believe Don Jones has done a series of training videos for CBT Nuggets. You can probably find out more at concentratedtechnology.com.

Jeffery Hicks
+2  A: 

I just found this free ebook, linked from the Windows PowerShell blog:

Mastering PowerShell

Jon Sagara
A: 

http://www.pwrshell.net I learned powershell from here (check the codecorner)

juFo