Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You want to create new events for other scripts to consume or want to respond automatically when they occur.
Use the New-Event cmdlet to
generate a custom event. Use the -Action parameter of
the Register-EngineEvent cmdlet to respond to that
event automatically.
PS > Register-EngineEvent -SourceIdentifier Custom.Event `
-Action { Write-Host "Received Event" }
PS > $null = New-Event Custom.Event
Received Event
The New-Event cmdlet lets you create new
custom events for other scripts or event registrations to consume. When
you call the New-Event cmdlet, PowerShell adds a new
entry to the session-wide event repository called the event
queue. You can use the Get-Event cmdlet to see events added to
this queue, or you can use the Register-EngineEvent cmdlet to have PowerShell respond
automatically.