O'Reilly logo

Windows PowerShell in Action, Third Edition by Bruce Payette Richard Siddaway

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. PowerShell functions

This chapter covers

  • Fundamentals of PowerShell functions
  • Function parameters and return values
  • Functions in the pipeline
  • Variable scoping

Porcupine quills. We’ve always done it with porcupine quills.

Dilbert

In this chapter we’ll begin looking at how to create reusable commands by combining the features from the previous chapters. Functions and scripts are the two command types that can be written in the PowerShell language. (Cmdlets and external commands are written in a language such as C# that can be compiled.) We’ll start with functions because they’re simpler. In the next chapter, we’ll cover scripts as well as introduce advanced programming features available to both functions and scripts.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required