PS Studio: have a script, where to start to convert to interactive form?

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 7 years and 9 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
stevens
Posts: 493
Last visit: Mon Sep 19, 2022 12:23 am
Has voted: 2 times

PS Studio: have a script, where to start to convert to interactive form?

Post by stevens »

Product, version and build: latest
32 or 64 bit version of product: 64-bit
Operating system: W212R2
32 or 64 bit OS: 64
PowerShell Version: latest

DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

Hi,

I just bougth & installed PS Studio latest version.
I do have a script which shows in a gridview a RDS 2012 farm (W2012 servers) for users logged on, what applications they use, what group they belong to.

I now would like to make this gridview interactive so you can logoff users, set a server in maintenance, send a message to some or multiple users etc.
I have the script but don't know howto start with PS studio. Would like to get the basic concepts and then make the form.

Please advise.
Steven
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: PS Studio: have a script, where to start to convert to interactive form?

Post by davidc »

[TOPIC MOVED TO POWERSHELL GUIS BY MODERATOR]

We have an article that helps you get started with PowerShell GUIs:

http://info.sapien.com/index.php/guis/g ... do-i-start

I also recommend looking our other GUI related articles, which are now are all in one easy to find location:

http://info.sapien.com/index.php/guis



David
David
SAPIEN Technologies, Inc.
User avatar
dan.potter
Posts: 709
Last visit: Wed Nov 14, 2018 11:39 am

Re: PS Studio: have a script, where to start to convert to interactive form?

Post by dan.potter »

Hi Steven,

To tackle all you want to do is a very long answer. First I suggest building a form and dropping a datagridview control onto it. Figure out how to populate it with your data. Practice retrieving data from it.

Next. Add buttons, menus etc. Each control has selectable events you can use to start certain actions.

For example. This would be your logic.

$buttonstopservices_Click = {

get the datagridview selected row; cells[1] is servername; execute script to stop services on servername
}
This topic is 7 years and 9 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