Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 2.0 » Register-EngineEvent

Register-EngineEvent - Powershell 2.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »

Register-EngineEvent

Short description
Subscribes to events that are generated by the Windows PowerShell engine and by the New-Event cmdlet.

Syntax


Description
The Register-EngineEvent cmdlet subscribes to events that are generated by the Windows PowerShell engine and the Ne
w-Event cmdlet. Use the SourceIdentifier parameter to specify the event.

You can use this cmdlet to subscribe to the "Exiting" engine event and events generated by the New-Event cmdlet. Th
ese events are automatically added to your event queue in your session without subscribing. However, subscribing le
ts you forward the events, specify an action to respond to the events, and cancel the subscription. 

When the subscribed event is raised, it is added to the event queue in your session. To get events in the event que
ue, use the Get-Event cmdlet. 

When you subscribe to a event, an event subcriber is added to your session. To get the event subscribers in the ses
sion, use the Get-EventSubscriber cmdlet. To cancel the subscription, use the Unregister-Event cmdlet, which delete
s the event subscriber from the session.