trying to get a function loaded from a PSM1 to write to a PSF-defined text box

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Post Reply
User avatar
fvenezia65
Posts: 1
Joined: Sun Mar 03, 2013 12:42 pm

trying to get a function loaded from a PSM1 to write to a PSF-defined text box

Post by fvenezia65 » Wed Nov 07, 2018 1:12 pm

Product, version and build: Powershell studio 2018 / Powershell version 5.0.10586.117
32 or 64 bit version of product: 64-bit
Operating system: Win-7 Pro
32 or 64 bit OS: 64-bit

Hi.
I am trying to enable some functions i've defined in a PSM1 module that is loaded with a Posh GUI Form to write back to a text box on the main form. But i am unable to do so.

I can write to this text box from the code in the .PSF file that i am creating a 32-bit EXE from; however i am unable to get a function that loaded via a PSM1, when the form loads with an import-module, to be able to write to the form's text-box (for function status updates).

FYI - this product is awesome.

Thanks for any help!
-frank

User avatar
davidc
Posts: 5474
Joined: Thu Aug 18, 2011 4:56 am

Re: trying to get a function loaded from a PSM1 to write to a PSF-defined text box

Post by davidc » Fri Nov 09, 2018 7:49 am

[TOPIC MOVED TO POWERSHELL GUIS FORUM]

If you can provide an example, we will be able to assist you further. Typically, you want to use the Out-String to set the Text of the textbox control.

Code: Select all

$textBox1.Text = Get-Process | Out-String
I recommend looking at the "TextBox - Get Process" control set (located in Tools Panel->Control Sets tab).

More info on TextBox control:

https://info.sapien.com/index.php/guis/gui-controls/spotlight-on-the-textbox-control
David
SAPIEN Technologies, Inc.

Post Reply