Search code examples
powershell-ise

Powershell Multiple TextBox into one line?


This does give the output from the first and second textbox, but I want it to look like this:

ABC:DEF

But this script gives me:

ABC : DEF

I do not want that space. The script:

    $text = $firstTextBox.Text,':',$secondTextBox.Text
    ...
    Add-Content $ScriptDir\test.txt "$text"

Solution

  • Please try this: $text = $firstTextBox.Text + ':' + $secondTextBox.Text