Summary

Completed

In this module, you learned how you can use PowerShell to automate tasks by writing and running scripts.

You went on to improve your scripts by using variables and parameters to make the scripts more flexible.

You then learned about flow control, and how you can use it to control how a script is run. You implemented some checks to sanitize input to ensure the script will exit early if certain conditions aren't met. You also added checks to ensure the script carries out its task (backing up files) only if there's no pre-existing backup file.

Finally, you were introduced to error handling. You learned how to differentiate between non-terminating and terminating errors and how to manage both.

You should now have a good understanding of how to write and run scripts. You should also be able to use various PowerShell constructs to improve a script's flexibility and robustness.