Who know it would be so easy to create programs from the command line?
# Brief: This example shows how to use PowerEvents to create a WMI event consumer that calls a script in response to a print job completing. New-WmiEventConsumer -Name ScriptWithArgs -ConsumerType ...
Each section is independent—use only what you need.