...
The PowerShell CLI can be used by jobs to submit events. Usually separate job steps or monitor scripts are used as e.g. with
- the JITL job JobSchedulerSubmitEventJob
- the JITL monitor JobSchedulerSubmitEventMonitor
Instead of additional job steps or monitors monitor scripts the Add-JobSchedulerEvent
cmdlet can be used to create events directly within a job:
...
- The
Add-JobSchedulerEvent
cmdlet returns an event object that can be used for later pipelining - Event processing occurs asynchroneously, therefore newly created events might take some seconds to be available for retrieval..
- The
Get-JobSchedulerEvent
cmdlet retrieves an array of event objects that are available with JobScheduler. - A previously created event object can be pipelined to the
Remove-JobSchedulerEvent
cmdlet. - In a more general sense all events as returned from
Get-EventJobSchedulerEvent
can be pipelined to theRemove-EventJobSchedulerEvent
cmdlet.