Chapter 7. PowerShell functions
|7.1||Fundamentals of PowerShell functions|
|7.2||Declaring formal parameters for a function|
|7.3||Returning values from functions|
|7.4||Using simple functions in a pipeline|
|7.5||Managing function definitions in a session|
|7.6||Variable scoping in functions|
Porcupine quills. We’ve always done it with porcupine quills.
In this chapter, we’ll begin looking at how to combine the features from the previous chapters into reusable commands. As you’ll recall from chapter 2, there are four types of PowerShell commands: functions, cmdlets, scripts, and external commands. Functions and scripts are the two command types that can be written in the PowerShell language. We’ll start with functions as they’re ...