Book Image

Mastering Windows PowerShell Scripting

By : Brenton J.W. Blawat
Book Image

Mastering Windows PowerShell Scripting

By: Brenton J.W. Blawat

Overview of this book

Table of Contents (22 chapters)
Mastering Windows PowerShell Scripting
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Best practices for software automation


Automation through PowerShell can be a very powerful tool when it's done right. There are few things that you can do, however, they will reduce the complexity of large automation scripts and increase reliability of execution. This section explores two things you can do that will greatly improve your success with automation whenusing PowerShell.

The first consideration is breaking apart scripts that contain 2000+ lines into smaller scripts. This allows you to better troubleshoot what items are failing and also makes the scripts more reusable for different tasks in your environment. For most purposes, you can break your large scripts into multiple scripts by what you're trying to accomplish. If you are installing a large software system, you could break the script into the prerequisite software scripts and main software scripts. If you are configuring different Windows features, you could break each individual feature installation and configuration into...