23 Squashing bugs
No comprehensive scripting guide is complete without addressing the critical topic of debugging. To put it bluntly, debugging can be frustrating. But don’t worry—we’re here to offer valuable insights and practical tips to make debugging more manageable.
23.1 The three kinds of bugs
In the world of scripting, bugs generally fall into three categories: syntax, results, and logic bugs. Results bugs, a relatively new category, has emerged to help address specific scenarios that often perplex scriptwriters. These bug families, in ascending order of complexity, are as follows:
-
Syntax bugs—You typed something wrong. Perhaps you typed ForEach instead of Foreach Object, for example, or you forgot to close a
{
(curly bracket). PowerShell ...
Get Learn PowerShell Scripting in a Month of Lunches, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.