19REFACTORING YOUR CODE

Images

In the preceding chapter, you built a VM with a running SQL server using nothing besides an existing hypervisor, an operating system ISO file, and a little bit of code. Doing so meant linking together many of the functions you created in the previous chapters. Here, you’ll do something different: instead of adding new functionality to your PowerLab module, you’ll dig into your code and see if you can make your module a little more modular.

When I say modular, I’m talking about separating the functionality of the code into reusable functions that can handle many situations. The more modular the code, the more generally applicable ...

Get PowerShell for Sysadmins 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.