One easily correctable problem that can cause debugging nightmares in a script involves variables. Variables are often used incorrectly, are nonexistent, or are initialized improperly. An easy mistake to make when using variables is a simple typing error. Simple typing errors can also cause problems when contained in a large complex script. Enabling strict mode causes Windows PowerShell to display an error if a variable is not declared. This helps you to avoid the problem of nonexistent or improperly initialized variables.
An example of a simple typing error in a script is shown in the SimpleTypingError.ps1 script.
$a = 2 $b = 5 $d = $a + $b 'The value of $c is: ' + $c ...