Generally speaking, there are three types of programming error - syntax errors, run-time errors and logic errors.

Syntax errors are mistakes in program code that cause the compiler or interpreter to abort, therefore preventing the program from running.  Such errors are quite common and are often caused by trivial mistakes that are easily overlooked (such as missing brackets or misspelt keywords).  Syntax errors only cause issues during the development phase.

Run-time errors occur when the program is executing and can cause a program to fail or behave in an unintended manner.   Examples include an attempt to perform an illegal operation (such as a divide-by-zero), integer overflows, buffer over-runs, referencing memory that isn't owned by the current thread/process, stack overflows, resource exhaustion, Etc.  The majority of PowerShell run-time errors are related to data and data types and most can be mitigated by using , and .

Finally, logic errors are mistakes in the program logic, or algorithm itself.  Such errors don't typically cause a program to abend; they normally cause unintentional behaviour and may prevent the program from achieving its objective.  For example, a program may enter into an infinite loop, due to a counter variable not being modified, or a recursive routine may never return due to its exit criteria never being satisfied.   Such errors are more easily solved using a debugger that can monitor program flow and watch variable values.