Preface
PowerShell is a free, powerful, and easy-to-learn programming language. Originally written as a scripting and administration tool for Windows, it’s now available as an open source resource that can be installed on almost all laptops and desktops. I have been teaching PowerShell to my colleagues for the last decade, and in my spare time, I teach coding to kids in local schools, mostly in Python. Why not teach coding with PowerShell?
Many books and courses on PowerShell assume an audience with access to multiple machines, Active Directory domains, and various other enterprise environments. They often also play down the traditional coding elements of PowerShell. This book does neither and attempts to teach coding with PowerShell, in a similar way to how we teach coding with Python. I’ve been inspired by the incredible work of Dr Chuck Severance of the University of Michigan – if you want to learn Python, his Python for Everybody course at py4e.org is excellent.
The book is split into three parts. In the first part, we cover traditional coding theory; starting with how PowerShell works as a language, we look at the building blocks of the language and then move on to how we can combine them in a programmatic flow.
In the second part, we start to put together the principles we’ve learned into scripts and modules that we can share and reuse.
In the final part of the book, we look at how PowerShell works in different environments, before finishing with a chapter on how we can access the underlying framework that PowerShell is built on.
I’ve included many interesting and varied examples and exercises in the book. To get the most out of it, I encourage you to actually type out the code, rather than just read it; the physical act of typing it drives a much deeper engagement than just scanning it ever will. Try out the questions and activities, and have a good think about the questions before skipping ahead to the answers. You’ll get much more out of the exercises if you have to work a little.
I would love to hear what you think and any suggestions you have for how the book might be improved.