Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In any programming language, code reusability is both common and important. It increases productivity and decreases the need to write redundant code blocks. Another important basic functionality in any programming language is the scope of variables and functions.
This chapter focuses on the reusability of PowerShell scripting. You will learn how to reuse code blocks through functions, sourcing files, and user profiles. You will also be introduced to variable scopes and function scopes. Finally, this chapter also covers transcripts.