Introduction

Hello, and thank you for buying this book. I sat in the audience at the Professional Developers Conference in Los Angeles in 2003, where Jeffrey Snover introduced Monad, which was later to become Windows PowerShell. I was excited about what I saw and heard; it was a seminal moment in my career.

Today we have a new version of PowerShell, PowerShell 7, to get excited about all over again. The PowerShell development team, combined with a fantastic community, has taken PowerShell to a new level. I continue to be excited, and I hope you are.

Before you dive into the body of this book, I hope you might take a few moments to read this short introduction where I explain my motivation for writing the book, its structure, and how you can use the PowerShell scripts in this book using Hyper‐V VMs.

This book contains 10 chapters. The first chapter looks at setting up PowerShell 7 in your environment. Chapter 2 examines the issue of Windows PowerShell compatibility and shows how PowerShell 7 addresses this challenge. The remaining eight chapters cover various Windows Server features and how you manage them with PowerShell 7. Here's a short overview of what is in this book:

I wrote this book to show you, the IT pro, that moving to PowerShell 7 is easy and worth your while. Just like when moving your home, things are a bit different in PowerShell 7. But once you get settled in, you are unlikely to look back. Along with VS Code, PowerShell 7 is just better. And I hope that each chapter of this book demonstrates that.

This book assumes you are an IT professional wanting to learn how to make the most of PowerShell 7. You might be an active administrator, a consultant, or a manager. You should have a background in both Windows Server features and broadly what they do, along with an understanding of Windows PowerShell itself.

The book looks at a variety of core Windows features including Active Directory, File Services Resource Manager, WMI, printing, and more. Each chapter describes a feature area and the components with which you interact. Then the chapter shows you how you can use PowerShell 7 to deploy, manage, and leverage that feature.

In this book (and indeed any book on PowerShell), it's not possible to cover every aspect of every feature set of Windows. As Jeffrey Snover says, “To ship is to choose,” and I hope I have chosen wisely. I have also provided pointers to where you can find more information. You are welcome to email me and give me feedback ( DoctorDNS@Gmail.Com).

This book contains a variety of scripts that you can use to manage some aspects of Windows using PowerShell 7. You can download these scripts either from the Wiley site or from my GitHub repository at github.com/doctordns/Wiley20 . In the unlikely event you discover an issue with any of the scripts or find issues with the documentation, please file an issue report on the GitHub repository (github.com/doctordns/Wiley20/issues).

A key goal in developing this book is to demonstrate how easily you can use PowerShell 7 to manage a Windows Server infrastructure. There is a difference in how you install it, and you have to get used to VS Code as a replacement to the ISE. Along the way, I discovered a few issues around compatibility with Windows PowerShell, and I discuss these in Chapter 2. It is time to move forward to PowerShell 7.

I built the scripts and the book content based on a set of Windows Server 2019 Datacenter edition Hyper‐V VMs. To get the most value from this book and the scripts it contains, you should build the VMs yourself and use them to test the scripts. Of course, you can use physical hosts as an alternative to virtual machines, but VMs are simpler to use. For readers who may not have the necessary hardware at hand, I include screenshots showing the output of each step of each script. To assist in creating the VMs, I have created a set of scripts. You can find these on GitHub; see Chapter 1 for more information on these scripts and how to obtain them.

One impressive aspect of PowerShell, from the beginning, is the rich and vibrant PowerShell community. There are hundreds of people around the world who love PowerShell and have delivered all kinds of goodness: tweets, forum posts, blog articles, scripts, modules, web sites, and more. A fair number of features in PowerShell 7 come from the community.

Should you have any problem with any aspect of any component of this book—or any aspect of Windows—there is no shortage of help and guidance you can find on the Internet.

Pretty much any social media site where techies can congregate is going to have PowerShell content, help, and assistance. Feel free to visit the PowerShell forum on Spiceworks where I am a moderator (community.spiceworks.com/programming/powershell).

With that said, enjoy the book and enjoy PowerShell 7.

Fare thee well now,
Let your life proceed by its own design.
Nothing to tell now,
Let the words be yours; I'm done with mine.
“Cassidy,” John Barlow/Robert Weir

Thomas Lee
June 2020
Cookham, England