Chapter 2. Using PowerShell
This chapter covers
- PowerShell cmdlets
- PowerShell and .NET
- PowerShell scripting language
- Creating PowerShell code for reuse
You saw in chapter 1 that automation is the key to reducing pressure on Windows administrators and that it will also reduce the cost of managing IT environments. PowerShell is my preferred automation platform because it’s available across the Windows environment, it’s built into major Microsoft applications, and it’s being adopted by an increasing number of third-party vendors. It’s also the most powerful shell and scripting language available on the Windows platform, as it can leverage the .NET Framework.
In this chapter, we’ll turn our attention to PowerShell. We’ll focus on WMI in chapter 3. If you’re familiar with PowerShell, you can skip this chapter or treat it as a refresher. It will also introduce some of the aspects of my style of using PowerShell and go over the terminology I’ll be using. My PowerShell style is to use full names for cmdlets and parameters. I don’t use aliases apart from the *object cmd-lets, and I keep the names and parameters of my functions in lowercase so I can easily distinguish them. The full details of my coding style can be found in the “about this book” section at the beginning of the book.