Summary

This chapter explored some of the fundamental components that are required for creating PowerShell scripts. These components include functions, loops, and switches. Each of these structures has a purpose within your scripts and can reduce the amount of effort in creating your scripts.

During this chapter, you explored how to create the structure of functions. You also learned how to feed arguments into these scripts and return values from a function.

The chapter also explained how you can create different types of looping structures. These looping structures include Do/Until, Do/While, ForEach, and For. The Do/Until loop was designed to execute until a variable equals a value. The Do/While loop will execute while a variable equals a value. ...

Get Mastering Windows PowerShell Scripting 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.