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.
This topic is 5 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
bzowky
Posts: 7
Last visit: Mon Sep 16, 2019 3:13 pm

Assistance Creating Simple Tool

Post by bzowky »

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: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Assistance Creating Simple Tool

Post by Alexander Riedel »

[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.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Assistance Creating Simple Tool

Post by jvierra »

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.

user-interface-design-for-administrators
and

https://info.sapien.com/index.php/guis/gui-scripting
This topic is 5 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked