concept execution in category powershell

This is an excerpt from Manning's book Windows PowerShell in Action, Third Edition.
Second, in the ForEach-Object case, the execution of the pipeline element generating the object is interleaved with the execution of the ForEach-Object cmdlet. The command generates one object at a time and then passes it to foreach for processing before generating the next element. This means the statement list can affect how subsequent pipeline input objects are generated.
In this chapter, we’ll focus on how PowerShell reports, records, and manages error conditions. Handling of error conditions is one of the areas where PowerShell shines compared to other scripting tools. The support for diagnostic tracing and logging is practically unprecedented in traditional scripting languages. Unfortunately, these features don’t come entirely free—there are costs in terms of complexity and execution overhead that aren’t there in other environments. All these capabilities are a part of PowerShell as a management tool; Microsoft set a higher bar for PowerShell than has been set for most other language environments.
This section will deal with the ways that PowerShell processes errors that terminate the current flow of execution, also called terminating errors. If you have a programming background, you’re probably more familiar with terminating errors when they’re called by their more conventional name—exceptions. Call them what you will; we’re going to delve into catching these terminating errors. We’ll look at ways to trap or catch these errors and take action as a consequence. In some cases, these may be remedial actions (such as trying to fix the problem) or recording that the errors occurred.

This is an excerpt from Manning's book PowerShell in Depth, Second Edition.
Note that some modules are script modules, meaning they can load only if you’ve enabled execution of scripts. If you try to load one on a default PowerShell configuration where scripting isn’t enabled, you’ll get an error message. You’ll need to enable script execution, which we cover in chapter 17, or you can read the help for the Set-ExecutionPolicy command to learn how to load such a module.