Assistance Creating Simple Tool

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.
User avatar
Posts: 7
Joined: Mon Sep 30, 2013 1:33 pm

Assistance Creating Simple Tool

Post by bzowky » Tue Jan 08, 2019 1:25 pm

Hey All -

I've testing PowerShell Studio currently and considering purchasing a copy if it does what i need.

For my first test, I'm trying to create a fairly simple GUI tool where one would paste in a list of hostnames (one per row), browse to a batch file, then click "Execute" which would copy and run the batch file (locally) on each of the hostnames using PSEXEC. For example, if wmifix.bat was selected, it would run the string "psexec.exe -f c:\wmifix.bat" against each of the listed hostnames.

Unfortunately, I haven't been able to find many examples for how to make something basic like this.

Any links or suggestions you have would be fantastic - Thank You!

I'm using PowerShell Studio 2018 on Windows 10 1809 x64

Thank You!

User avatar
Alexander Riedel
Posts: 7049
Joined: Tue May 29, 2007 4:43 pm

Re: Assistance Creating Simple Tool

Post by Alexander Riedel » Tue Jan 08, 2019 1:34 pm

[Moved to correct forum by moderator]

It is pretty basic and certainly possible. To get started, we would need to know what your level of PowerShell knowledge is and what you have already set up. I mean what you describe is pretty simple to do in a command line script, taking the host names from a file rather than pasting them.
If you, by any chance have already that part done, describe where you are having difficulties with the transition to a GUI.
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
Posts: 13793
Joined: Tue May 22, 2007 9:57 am

Re: Assistance Creating Simple Tool

Post by jvierra » Tue Jan 08, 2019 1:52 pm

You would use a multi-line textbox which accepts paste.

A button can read the textbox and execute other commands.

To get familiar with working with forms and controls see the following articles.