Racking my brains here, and i'm sure it's something simple.
I've built this simple form app that runs an exe in cmd.
The problem is when i click the build iso button the function runs but only outputs the first line of the .exe and the rest of the output is passed to the terminal and not in the textbox?.
It's almost as if the textbox won't accept more than one line, even though i have multiline set to $true?
The yellow text in terminal should be in the textbox as well:
Code:
Function xiso_build {
Set-Location -Path $PSScriptRoot # change to root folder of this script wherever it's run from
$outputbox.text = & .\extract-xiso.exe -r $selected_file | out-string
}
# Output of xtract-iso textbox
$global:outputBox = New-Object System.Windows.Forms.TextBox #creating the text box
$outputBox.Location = '10,150' #location of the text box (px) in relation to the primary window's edges (length, height)
$outputBox.Size = New-Object System.Drawing.Size(565,200) #the size in px of the text box (length, height)
$outputBox.MultiLine = $True #declaring the text box as multi-line
$outputBox.ScrollBars = "Vertical" #adding scroll bars if required
$form.Controls.Add($outputBox) #activating the text box inside the primary window
# Build Iso Button
$build_button = New-Object System.Windows.Forms.button
$build_button.Text = 'Build ISO'
$build_button.Size = '200,50'
$build_button.Location = '10,360'
# $button.Anchor = 'Bottom,left' # uncomment to move button down to bottom left of app window
$form.Controls.Add($build_button)
$build_button.Add_Click({xiso_build }) # run 'xiso_build' func from above
I'm at a loss here as to have all output in textbox. Thanks all