O'Reilly logo

PowerShell Troubleshooting Guide by Michael Shepard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required