InfoQ

News

Free PowerShell Book

Posted by Jonathan Allen on Jul 26, 2007

Community
.NET
Topics
Artifacts & Tools
Tags
PowerShell

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. 


I Love Powershell! by John DeHope Posted Jul 27, 2007 8:22 AM
Re: I Love Powershell! by Alex Popescu Posted Jul 29, 2007 3:20 AM
  1. Back to top

    I Love Powershell!

    Jul 27, 2007 8:22 AM 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!

  2. Back to top

    Re: I Love Powershell!

    Jul 29, 2007 3:20 AM 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...)

    ./alex
    --
    .w( the_mindstorm )p.
    ________________________
    Alexandru Popescu
    Senior Software Eng.
    InfoQ TechLead&CoFounder

Educational Content

QCon SF Keynote: Techie VC's Talk About Trends & Opportunities

Kevin Efrusy and Salil Deshpande talk about what makes a business successful or not, presenting three actual cases they have been involved with: Hyperic, G2One, SpringSource.

Project Lead Mark Fisher Discusses the Spring Integration Project

InfoQ talks to Mark Fisher, project lead for the Spring Integration project, about the framework.

How HTML5 Web Sockets Interact With Proxy Servers

Peter Lubbers explains in this article how HTML5 Web Sockets interact with proxy servers, and what proxy configuration or updates are needed for the Web Sockets traffic to go through.

Rails in the Large: How Agility Allows Us to Build One Of the World's Biggest Rails Apps

Neal Ford shows what ThoughtWorks learned from scaling Rails development: infrastructure, testing, messaging, optimization, performance.

Stuart Halloway on Clojure and Functional Programming

Stuart Halloway discusses Clojure and functional programing on the JVM in depth, and touches on the uses of a number of other modern JVM languages including JRuby, Groovy, Scala and Haskell.

Oren Teich and Blake Mizerany on Heroku

Oren Teich and Blake Mizerany talk about the technology behind Heroku and the benefits of the new add-on system.

Security for the Services World

Chris Riley presents security issues threatening service based systems, examining security threats, presenting measures to reduce the risks, and mentioning available security frameworks.

Navigating The Rapids:Real-World Lessons in Adopting Agile

This talk investigates technical issues encountered when moving to an Agile process.