Thanks in advance for any help. I'm trying to use PowerShell V5 to generate an event in which I can trigger an action. In the example, I'm just trying to write-output as my action. When I print, the event isn't triggered though. What am I missing?
$print = new-object system.drawing.printing.printdocument
register-objectevent -inputobject $print -eventname beginprint -sourceidentifier print.beginprint -Action { write-output "Event triggered" }
Get-job shows the job in a 'Not Started' state.
Thanks again.