Chapter 2. Scripting Windows PowerShell

After completing this chapter, you will be able to:

  • Configure the scripting policy for Windows PowerShell.

  • Run Windows PowerShell scripts.

  • Use Windows PowerShell flow control statements.

  • Use decision-making and branching statements.

  • Identify and work with data types.

  • Use regular expressions to provide advanced matching capabilities.

  • Use command-line arguments.

Note

On the Companion Disc All the scripts used in this chapter are located on the CD that accompanies this book in the \scripts\chapter02 folder.

Why Use Scripting?

For many network administrators writing scripts—any kind of scripts—is a dark art more akin to reading tea leaves than administering a server. Indeed, while most large corporations seem to always ...

Get Windows PowerShell™ Scripting Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.