6 Making adaptable automations

This chapter covers

  • Using event handling to account for known errors
  • Creating dynamic functions
  • Using external data in your scripts

One of the toughest challenges you will face with automation is figuring out how to make things as efficient and maintainable as possible. The best way to achieve that is by making your code as smart and adaptable as possible. As you will see, adaptable scripting can mean many different things. For example, something as simple as adding parameters to a function makes your code more adaptable. But in this chapter, we will take it to the next level by making functions that can account for potential known errors and resolve them and make a function that can create dynamic if/else statements ...

Get Practical Automation with PowerShell 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.