Reputation: 133
I know this a simple solution but I can not figure out the syntax. I'm trying to take information from a multi-line TextBox and place it in a file when a button click happens. Here is where I'm at currently as an incomplete idea of where I'm going with it. The problem is I want to take a list of Machines from a GUI text box and place it into a text file.
$button.add_button(
Get-Content $AddButton.TEXT | Foreach-Object {" I want to pipe into a c:\temp\PROD\Machines.txt"})
Any suggestions?
Thanks
Upvotes: 0
Views: 3447
Reputation: 8650
Really not sure were I should start... ;)
Add_Click
$AddButon
is your TextBox - you can access property directly rather than use Get-Content
cmdletOut-File
Code:
$button.Add_Click({
$AddButton.Text | Out-File c:\temp\PROD\Machines.txt
})
Not tested.
Upvotes: 2