Book Image

PowerShell Troubleshooting Guide

By : Mike Shepard
Book Image

PowerShell Troubleshooting Guide

By: Mike Shepard

Overview of this book

Table of Contents (15 chapters)
PowerShell Troubleshooting Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 5. Proactive PowerShell

PowerShell includes capabilities to improve the quality of scripts that will prevent some of the problems that might be encountered in the scripting process. In this chapter, we'll cover the following topics:

  • Error handling (try/catch versus trap)

  • Parameterization and pipeline input

  • Pipelines and function execution

  • Parameter validation

  • Parameter type transformation

  • Strictmode/PSDebug

  • #REQUIRES statements (version or administrator)

  • CmdletBinding and common parameters