PSGUI – Powershell – RaiseEvent

Hello together

if you want to raise an event by your powershell code use the following command:

$GUI_Manager_rCodeBehind.RaiseEvent((New-Object -TypeName System.Windows.RoutedEventArgs -ArgumentList $([System.Windows.Controls.Button]::ClickEvent)))

The variable (here: $GUI_Manager_rCodeBehind) is the object from which you want to raise the event. In the parameters you have to insert your event in the ArgumentList. This example is for a ButtonClick event – [System.Windows.Controls.Button]::ClickEvent).

May be you will need it at some point.

Greetings,

David

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s