Free PowerShell Book

| by Jonathan Allen Follow 465 Followers on Jul 26, 2007. Estimated reading time: 1 minute |

A note to our readers: You asked so we have developed a set of features that allow you to reduce the noise: you can get email and web notifications for topics you are interested in. Learn more about our new features.

Frank Koch of Microsoft Switzerland has released a free mini-book on Windows PowerShell.

Windows PowerShell is a replacement for the DOS-based command prompt currently distributed with Windows. Inspired by the powerful shells found in Linux, PowerShell gives administrators full access to COM and .NET libraries from the command prompt.

One of the key topics covered by this book is piping. Unlike UNIX based shells, PowerShell doesn't pipe just text. Instead, it is based on the ability to pipe objects from one command to the next.

For example, consider this command.

get-wmiobject -class win32_computersystem | get-member | sort name

The first part gets the WMI object Win32.ComputerSystem.
In order to get a list of methods on the object, it is piped to the get-member command.
Finally, the list is piped to the sort command.

The concept of file systems and objects have been merged in PowerShell. This allows you to register an object model and explore it like a file system. Built-in "drives" include the Windows Registry, certificate stores, environmental variables, and aliases. There is even a "Variable" drive for working with shell variables. Just as in an actual drive, features such as Tab Completion work in these pseudo-drives.

Other interesting tricks found in this book include PowerShells support for numeric constants. Wherever numbers are allowed, one can write "512KB" and the shell will automatically convert into bytes. The suffix MB and GB are also supported.

You can download the book and sample code from the Scattered Notes blog. 

Rate this Article

Adoption Stage

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

I Love Powershell! by John DeHope

Thanks for this link. A friend of mine turned me on to powershell recently and I must say MS has really outdone themselves with this one. Now if I could just get my company to let me install it!

Re: I Love Powershell! by Alex Popescu

What were the features that sold you out to PowerShell? (I had it on my todo list for quite a while and never got to it...)

.w( the_mindstorm )p.
Alexandru Popescu
Senior Software Eng.
InfoQ TechLead&CoFounder

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

2 Discuss

Login to InfoQ to interact with what matters most to you.

Recover your password...


Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.


More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.


Stay up-to-date

Set up your notifications and don't miss out on content that matters to you