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.