Introduction to scripting
A script is a sequence of instructions written in a human-readable form for a computer to carry out. They are usually written in a scripting language such as PowerShell, Python, or JavaScript. We covered the differences between scripting languages and programming languages back in Chapter 1, Introduction to PowerShell 7 – What It Is and How to Get It; the key thing to remember is that scripting languages are interpreted and so need a program (such as PowerShell) to be running on the client to run the script, whereas programming languages are compiled; they will run directly in the operating system.
Scripting, to me, is an art form. It’s probably the truest cybernetic art form; what we write in a script has to make sense to both human beings and machines. In Chapter 6, PowerShell and Files – Reading, Writing, and Manipulating Data, we talked about Exercises in Programming Style by Cristina Videira Lopes, where a term frequency task was...