|
Hello
I have recently installed powershell 3.0 and ShowUI (great tool thank you) on my system, however I am experiencing some unexpected behavior.
Any event handler I use generates an invalid cast error. Example Code: (Sorry for some reason the insert code option is not responding for me - using chrome)
stackpanel -ControlName sp1 -Children{
button -Content "Click" -name button1 -On_Click{$rLabel.Content = get-random} -On_MouseEnter{
$rLabel.Background = "Black"
$rLabel.Foreground = "White"
}
label -name rLabel
} -show
Errors:
Specified cast is not valid.
Error in On_MouseEnter Event Handler on button1 (Button)
At line:3 char:1+ $ErrorActionPreference = 'stop'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specified cast is not valid.Error in On_Click Event Handler on button1 (Button)
At line:3 char:1+ $ErrorActionPreference = 'stop'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|