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 8 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.
dan.potter wrote:For display purposes as his first screenshot
His question is how to use a checkedlistbox to do what he did manually without PowerShell Studio.
What does the display have to do with objects in a checked listbox?
Now everything is in the listbox or checkd listbox.
We can even load it from a CSV file.
I guess I will preface my response by saying I'm just starting out using powershell/powershell forms so please forgive me if I am miss-understanding something. Having the installers coded directly into this form isn't really an option. In my ps1 file, each listbox item that is checked, when the "Install" button is clicked, fires off a series of scripts that install those programs. There are many custom things that we have to do with those programs in our environment that would not be solved by simply running the msi/exe file and inputing the arguments for those. I will attach the two scripts later.
Just place the script file names in the checked listbox. When you process the "CheckedItems" list just retrieve the script name from the list and execute it. I have done this many times for many different things.
Create a CSV file with namss and scritp names.
Name,ScriptPath
Adobe,c:\scri[ts\installadobe.ps1
Office,c:\scritps\install_office.ps1
....
Just load this into the checkedlist and run the scrits for each checked item.
This topic is 8 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.