Chapter 8. Advanced functions and scripts

 

This chapter covers:

  • 8.1 PowerShell scripts
  • 8.2 Writing advanced functions and scripts
  • 8.3 Dynamic parameters and dynamic-Param
  • 8.4 Documenting functions and scripts
  • 8.5 Summary

And now for something completely different...

Monty Python

In chapter 7, we introduced the basic elements needed for programming in Power-Shell when we looked at PowerShell functions. In this chapter we’re going to expand our repertoire by introducing PowerShell scripts.

Note

If you skipped chapter 7, you should probably go back and read it before proceeding. Why? Because all the material we covered on functions also applies to scripts.

Once we’re finished with the basics of scripts (which won’t take long), we’ll move on to the advanced production scripting features introduced in PowerShell v2. With these new features, it’s possible to use the PowerShell language to write full-featured applications complete with proper documentation. By the end of this chapter, you should be well on your way to becoming an expert PowerShell programmer.

8.1. PowerShell Scripts

8.2. Writing Advanced Functions and Scripts

8.3. Dynamic Parameters and Dynamicparam

8.4. Documenting Functions and Scripts

8.5. Summary