I'm new to Powershell/WPF and I'm having a simple problem that I couldn't solve. I am trying to get the text from the variable = TextBox but I'm getting "System.Windows.Controls.Button: Connect" instead.
Here's my PowerShell code.
$TextBox.Add_TextChanged({
$script:TextBoxPS = $TextBox.Text.ToString()
})
$Button.Add_Click({param($TextBoxPS)
Write-Host "$TextBoxPS"
})
I'm not sure what's the problem. Can you guys please help? Thank you so much in advance!