GUI - Mimic Console Window?

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
Swatto86
Posts: 26
Joined: Mon May 18, 2015 7:21 am

GUI - Mimic Console Window?

Post by Swatto86 » Fri Jul 05, 2019 1:01 am

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: Powershell Studio 2016, Version: 5.2.121
32 or 64 bit version of product: 64-bit
Operating system: Windows 10 Pro
32 or 64 bit OS: 64-bit

*** Please add details and screenshots as needed below. ***

Hi all,

I am making a GUI form for my robocopy script, is it possible to have a control to 'mimic' the console window in that the robocopy output gets displayed to it?

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

Re: GUI - Mimic Console Window?

Post by davidc » Fri Jul 05, 2019 7:21 am

I recommend looking at the Text Box - Redirect Process Output form template.

It allows you to run an external executable and the output is redirected to the TextBox control.
David
SAPIEN Technologies, Inc.

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

Re: GUI - Mimic Console Window?

Post by Swatto86 » Fri Jul 05, 2019 9:19 am

davidc wrote:
Fri Jul 05, 2019 7:21 am
I recommend looking at the Text Box - Redirect Process Output form template.

It allows you to run an external executable and the output is redirected to the TextBox control.
Thanks for the response davidc - is this available in Powershell Studio 2016? I cannot seem to find it.

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

Re: GUI - Mimic Console Window?

Post by davidc » Fri Jul 05, 2019 9:48 am

Sorry, I did not notice you were using 2016. This template is included in the 2019 version. You can try looking at this topic thread:

viewtopic.php?f=21&t=12969&hilit=redire ... t&start=10

It was the inspiration for the template.
David
SAPIEN Technologies, Inc.

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

Re: GUI - Mimic Console Window?

Post by Swatto86 » Fri Jul 05, 2019 10:05 am

Thanks david, guess I will have to update my version - so expensive for a hobbyist :/

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

Re: GUI - Mimic Console Window?

Post by davidc » Fri Jul 05, 2019 10:50 am

FYI, we are running sale:

https://www.sapien.com/blog/2019/07/03/ ... -60-years/

Hopefully that will help!
David
SAPIEN Technologies, Inc.

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

Re: GUI - Mimic Console Window?

Post by Swatto86 » Sun Jul 07, 2019 1:14 pm

Found an easy way to output the robocopy output to a textbox:
  1. robocopy $source $destination /E | ForEach-Object {
  2.  
  3.  
  4.  
  5.             $txtOutput.AppendText($_ + "`r`n")
  6.  
  7. }