PowerShell Tutorials : Making a GUI Part 8 - Multiple Forms

preview_player
Показать описание
Making a GUI (Graphical User Interface) with PowerShell with multiple windows. This was a request from Gyan, we will be creating a service inspector that you select a service and then click a button where a new window will appear letting you start, stop, restart the service.

Tags:
PowerShell
GUI
Programming
Scripting
Automating
JackedProgrammer
Coding
Рекомендации по теме
Комментарии
Автор

Thank you very much! That will be very helpfull for my Application! I was able to create a GUI with your lessons that remotely restart and Stop some services from a server and now with 2 GUI's, I will try to GET the status of each services without the needed of been logged into the server. The idea is to open a new GUI with all informations of status about those services that I've restarted. Thanks again!

IAmGyan
Автор

Still relevant, though powershell doesn't like the xaml file having 'click-"button_click"'; it wants a click event handler for the buttons within powershell itself. Easily corrected with AI. Thank you for guiding me on creating an app that lists, counts and exports members of groups from Active Directory.

kw
Автор

I haven't read through the comments on the other GUI videos to see if this has been addressed or not.

Have you considered turning that initial XAML to POSH setup into a module, since it needs to happen for every XAML file anyway? It would reduce the need to copy and paste it. You could also have a parameter for the function (e.g., ConvertTo-POSHXAML) for the file path.

NoelCruzSings
Автор

Hi JP, if you feel like it, would you please do a video on how to use powershell to send and pull text from web page text fields?

JohnSmith-nkvn
Автор

I've taken a closer look at this.

2 XAML files.
1 Powershell PS1.

The good part is that the XAML files can be faster changed in seperate files in visual studio.

Challenges though are to have an overview therefore I have collected 1 PS1 file with it all in total.

The challenges here are so you have to manually enter and customize each Form or copy it over to Visual studio and edit and return again in the rightplace.
But you do have the full overview in 1 file and can more easily adjust than the import part.

sblworld
Автор

How feasible would it be, to create a dynamic form with VS? Would be cool to see a video on that - like selecting a few mandatory comboboxes, and depending on what you select, the form populates with various other fields. I've done something like that by building the GUI in PS, using some homegrown basic algorithm to size the elements according to the input, but I was curious how that could be done with VS since GUI editing is a lot simpler.
EDIT: looks like I may have found my answer → StackPanel

nvlddmkm
Автор

I got the following error on one of my choice boxes. [WARNING: Unable to parse XML, with error: Exception calling "Load" with "1" argument(s): "Failed to create a 'SelectionChanged' from the text 'Environment'."
Ensure that there are NO SelectionChanged properties (PowerShell cannot process them)]

carlosalbor
Автор

Can we activate multiple buttons from a single form ?

Rishab_Saha
welcome to shbcf.ru