Get powershell function output?

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.
Locked
User avatar
Swatto86
Posts: 21
Joined: Mon May 18, 2015 7:21 am

Get powershell function output?

Post by Swatto86 » Tue Jun 09, 2015 2:56 pm

Hello all,

I have a form that runs a number of powershell functions but I do not know how to display the console output of what happens when the function runs in a label control on my form?

I can see the text within 'Output' in the IDE but when I build my app if a function has an error during execution I see nothing?

Thanks for any help.

User avatar
SAPIEN Support Forums
Posts: 945
Joined: Wed Dec 03, 2014 2:26 pm

Get powershell function output?

Post by SAPIEN Support Forums » Tue Jun 09, 2015 2:56 pm

This is an automated post. A real person will respond soon.

Thank you for posting, Swatto86.

Here are some hints to help you get an accurate and complete answer to your question.

Ask in the best forum: If you asked in the wrong forum, just copy your question to the right forum.

Anticipate follow-up questions!

Did you remember to include the following?
  • 1. Product, version and build
    2. 32 or 64 bit product
    3. Operating system, e.g. Windows 7 64 bit.
    4. Attach a screenshot, if applicable
    5. Attach logs, crash reports, etc., in a ZIP file
If not, please take a moment to edit your original post or reply to this one.

*** Make sure you do not post any licensing information ***

User avatar
jvierra
Posts: 13507
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Get powershell function output?

Post by jvierra » Tue Jun 09, 2015 4:28 pm

Start here and all will become clear shortly:

https://www.sapien.com/blog/topics/user ... istrators/

I had one guy once who thought that putting code inside of a control would cause the control to display the output. He wanted a button to show "running" or "stopped" based on a query that executed when he clicked the button. It took us days to convince him that it wouldn't work.

User avatar
Swatto86
Posts: 21
Joined: Mon May 18, 2015 7:21 am

Re: Get powershell function output?

Post by Swatto86 » Tue Jun 09, 2015 9:10 pm

Cheers found a great article on that blog section.

User avatar
jvierra
Posts: 13507
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Get powershell function output?

Post by jvierra » Wed Jun 10, 2015 1:29 am

Great.

It is always helpful to get a good overview with any new tool.

Locked