PSEventManager Class

Definition

Represents the interface to the PowerShell eventing functionality. This class allows you to subscribe to, and receive events.

public ref class PSEventManager abstract
public abstract class PSEventManager
type PSEventManager = class
Public MustInherit Class PSEventManager
Inheritance
PSEventManager

Constructors

PSEventManager()

Properties

ReceivedEvents

Represents the interface to the PowerShell event queue.

Subscribers

Gets the list of event subscribers.

Methods

CreateEvent(String, Object, Object[], PSObject)

Creates a PowerShell event.

An optional identifier that identifies the source event The object that generated this event Any event-specific data associated with the event. Any additional data you wish to attach to the event
GenerateEvent(String, Object, Object[], PSObject)

Generate a PowerShell event.

An optional identifier that identifies the source event The object that generated this event Any event-specific data associated with the event. Any additional data you wish to attach to the event
GenerateEvent(String, Object, Object[], PSObject, Boolean, Boolean)

Generate a PowerShell event.

An optional identifier that identifies the source event The object that generated this event Any event-specific data associated with the event. Any additional data you wish to attach to the event True if the event should be triggered in current thread. False for the event to be triggered in a separate thread. Wait for the event and associated action to be processed and completed.
GetEventSubscribers(String)

Get the event subscription that corresponds to an identifier

The identifier that identifies the source of the events
GetNextEventId()

Returns a sequential event ID

ProcessNewEvent(PSEventArgs, Boolean)

Processes new events (which have either been generated by this instance or forwarded to it)

ProcessNewEvent(PSEventArgs, Boolean, Boolean)

Processes new events (which have either been generated by this instance or forwarded to it)

SubscribeEvent(Object, String, String, PSObject, PSEventReceivedEventHandler, Boolean, Boolean)

Subscribes to an event on an object.

The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions
SubscribeEvent(Object, String, String, PSObject, PSEventReceivedEventHandler, Boolean, Boolean, Int32)

Subscribes to an event on an object.

The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions Indicate how many times the subscriber should be triggered before auto-unregister it If the value is equal or less than zero, there is no limit on the number of times the event can be triggered without being unregistered
SubscribeEvent(Object, String, String, PSObject, ScriptBlock, Boolean, Boolean)

Subscribes to an event on an object.

The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions
SubscribeEvent(Object, String, String, PSObject, ScriptBlock, Boolean, Boolean, Int32)

Subscribes to an event on an object.

The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions Indicate how many times the subscriber should be triggered before auto-unregister it If the value is equal or less than zero, there is no limit on the number of times the event can be triggered without being unregistered
UnsubscribeEvent(PSEventSubscriber)

Unsubscribes from an event on an object.

The subscriber associated with the event subscription

Applies to