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

Static analysis tools – ScriptCop and Script Analyzer


This chapter has focused on things that we can see when we look at code in a code review situation. Such observations are necessarily somewhat subjective and open to disagreement. Another approach to the problem of analyzing code is to use a static analysis tool. Static analysis tools read the source code and apply a set of rules to determine places that the rules are broken. A report from such a tool gives very quick input into the quality of the code.

Some languages have a long history of static analysis tools. The C language, for example, has lint. If you're using C#, you have probably heard of StyleCop and FxCop. PowerShell has two static analysis tools: ScriptCop and Script Analyzer.

ScriptCop

ScriptCop is a tool created by Start-Automating.com in 2011 and can be found at http://scriptcop.start-automating.com. It can be used to test a function or module either online, through a web form, or through a cmdlet interface. ScriptCop defines...