Chapter 1. Welcome to PowerShell
This chapter covers:
Space is big. Really big! You just won’t believe how vastly hugely mind-bogglingly big it is. I mean you may think it’s a long way down the road to the chemist, but that’s just peanuts compared to space!
Don’t Panic.
Douglas Adams, The Hitchhiker’s Guide to the Galaxy
Welcome to Windows PowerShell, the new command and scripting language from Microsoft. We begin this chapter with two quotes from The Hitchhiker’s Guide to the Galaxy. What do they have to do with a new scripting language? In essence, where a program solves a particular problem or problems, a programming language can solve any problem, at least in theory. That’s the “big, really big” part. The “Don’t Panic” bit is, well—don’t panic. Although PowerShell is new and different, it’s been designed to leverage what you already know, making it easy to learn. It’s also designed to allow you to learn it a bit at a time. Starting at the beginning, here’s the traditional “Hello world” program in PowerShell:
As you can see, no panic needed. But “Hello world” by itself isn’t very interesting. Here’s something a bit more complicated: