Powershell Item checkbox Value
Hello, Today i try set checkbox XAML for powershell, but when i created xaml and put this checkbox on formular, alway value is False. I created this function. When i click button without checkbutton and value is false, when i click on checkbutton and click button valu is still false.
function truornot {
if($check.Checked){
Write-host "Is true"
}else{
Write-host "Is False"
}
}
$button.Add_Click({
truornot
})
But when i show value $check and value is System.Windows.Controls.CheckBox Obsah:CheckBox IsChecked:False and when i click on checkbox value is System.Windows.Controls.CheckBox Obsah:CheckBox IsChecked:True
I dont understand why value $check.checked is still false. I try set $check.checked -eq $true