When trying to execute code or update values within a variable inside of the add_Click block, it does not work. I'm not sure if I am doing something incorrectly. Moreover, the statement I have following the code sees the variable as nonexistent.
$Button1.add_Click({$authEvent = $true
$Form.Close() })
$Button2.add_Click({$authEvent = $false
$Form.Close()
})
This should update the $authEvent variable depending on which button is clicked. As well as closing the form.