Permanent Event Subscription
All the event notifications described in the preceding section are examples of temporary event subscription. A script connects to WMI, registers (a.k.a. subscribes) to receive notification of a specified set of events and, provided that the script continues to run and notification is not explicitly cancelled, events will continue to be delivered each time they occur. As soon as a script quits, however, notification ceases. Likewise, unless a script is explicitly started, no events will ever be delivered. In short, the event delivery is temporary.
In many circumstances, this behavior is absolutely fine. If you need to ensure that particular types of events never go unnoticed, just make sure that the script written ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access