Summary

It is considered good practice to wrap scripts that you often use into something more reusable and extensible. Functions and modules are two PowerShell constructs that help you do that. This chapter provided an introduction to creating functions and script modules in PowerShell. You can build up on the basics that you learned from here to create more advanced functions or implement other types of modules.

Get PowerShell for SQL Server Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.