Events are a staple of .NET developers looking to react to changes of an object, for example. A .NET class mimicking a coffee machine, for instance, would raise an event coffee dispensed whenever a coffee is ordered. We can react to three kinds of events in PowerShell, as well:
Cmdlet | Event description |
| Events of .NET objects, for instance, the exited event of a |
| Events of WMI classes, for instance, an event that is raised whenever a new process starts |
| Events of the PowerShell engine, for instance, an event triggered when PowerShell is closing |
We will have a look at all three kinds of events through practical examples.