Sample chapter: Working with functions

In Windows PowerShell, functions have moved to the forefront as the primary programming element used when writing Windows PowerShell scripts.

After completing this chapter from Windows PowerShell Step by Step, Third Edition , you will be able to

      • Understand functions.
      • Use functions to provide ease of reuse.
      • Use functions to encapsulate logic.
      • Use functions to provide ease of modification.

There are clear-cut guidelines that can be used to design functions. These guidelines can be used to ensure that functions are easy to understand, easy to maintain, and easy to troubleshoot. This chapter examines the reasons for the scripting guidelines and provides examples of both good and bad code design.

Read this complete chapter here .