views:

42

answers:

1

I am looking for a book or a site or something which will hit on the powershell scripting. NOT in command line.

I have a couple of scripts I need to write, writing an application is overboard, but the language is confusing. Programming conventions I am used to from php and C# seem to be thrown out the window on some things, like if statements and calling functions. I am looking for something that will just walk me through some of these basics from a scripted file perspective not in commandline window. Most stuff I find they try to do really complex stuff in CLI not script files.

A: 

I originally bought a couple of books: "Windows Powershell Cookbook" and "Windows PowerShell in Action". I kind of used the Cookbook one for some time, and left PowerShell in Action to gather dust - big mistake. PowerShell in Action is very good and is written by Bruce Payette, one of the co-designers of the language:

http://www.manning.com/payette/

Whereas the Cookbook guides you through common-or-garden scenarios and scripts, Bruce's book goes through the language is good depth. It certainly helped me go from WTF -> ah!

PowerShell can be really quite confusing\frustrating when you're used to C# idioms, etc. This was the book that quickly turned me on to the PowerShell idioms that were previously driving me nuts. :)

chibacity
Thanks for the book reference i have seen it but wasn't really sure if I should get it. I think I will. I also hadn't thought too much about idioms of powershell so that kind of brings a new light to it.
percent20
There are lots of little things that tripped me up to begin with as I was used to C# e.g. if you call a function in PowerShell like func(arg1, arg2, arg3) then the arguments get turned into an array and passed as the first argument to the called function. Combined with the fact that arguments are optional, that sort of thing was confusing to begin with. Have fun! :)
chibacity