GUI repetitive multiple field input (replacing input csv files) best approaches

This topic contains 5 replies, has 3 voices, and was last updated by Profile photo of David Schmidtberger David Schmidtberger 10 months, 3 weeks ago.

  • Author
    Posts
  • #33856
    Profile photo of David Schmidtberger
    David Schmidtberger
    Participant

    So working my way through the learn powershell toolmaking in a month of lunches, and into gui creation.

    looking through the list of scripts that have been written for our group's use, most are geared towards doing the same tasks multiple times.

    IE creating a batch of groups, or distribution groups.

    today these scripts utilize an input csv file with all of the required fields. i'm trying to figure out the best approach to replicating this within a gui, to run theses as singles would be doable just using a number of input boxes, but once you need to run the task more than once, this becomes not very useful.

  • #33881
    Profile photo of Rob Simmers
    Rob Simmers
    Participant

    So, let's say you have 3 criteria to create a new Active Directory group: Name, Description and Manager. You create a function utilizing a process{} block and foreach item logic so that you can pass one record or hundreds. When you submit the form, you create an object with one row.

    The benefits of the GUI is that you can control what folks are entering in the form and can provide data. For instance, you can populate a dropdown with all possible group managers so that it's not manually inputted. You can use events like Leave (onBlur) that after typing a group name you could check if the group exists. GUI's help control what can be entered so that you can "user proof" entries. As soon as you allow bulk imports, you need to validate everything at runtime, produce an error, and re-submit.. Does the samAccountName passed for the manager exist? Does the group already exist? Another option with your GUI is to provide a file browser with a CSV filter to select a file or files (assuming multi-select is enabled).

    Personally, I build GUI's when I need to make advanced scripts that users need to use to be impossible (or atleast really hard) to mess up.

  • #33883
    Profile photo of Tim Pringle
    Tim Pringle
    Participant

    Agree with Rob re for multiple operations, you're still going to be best placed to have some sort of input file, if you must use a GUI.

    For the type of operating you are talking about, batch processing is best placed. You can still do this using a GUI via the above method, but you've got to ask yourself what are the benefits.

    I'm a bit like Rob. I write applications using a GUI for when it's to be used by other people as opposed to myself. For me, command line rules!

  • #33908
    Profile photo of David Schmidtberger
    David Schmidtberger
    Participant

    well, thats my issue, i wrote all of these process for myself, but to try and remove errors in manual processes we have tried to move the scripts into every day use, but it has been a struggle to get the processes used reliably. manually performing the actions in peoples minds via ad gui or exchange gui is seen as "easier" than remembering the script, and filling out the input file.

    i am generally pretty good in the script files validating for data.

    for now i'm kind of thinking about just using a couple of radio buttons, one for "singles" and one for batch, and have the batch just open an input csv file to fill out.

    was just sort of hoping someone had something like an input grid to have multiple entries

  • #33935
    Profile photo of Tim Pringle
    Tim Pringle
    Participant

    Hmmmm...I think you might be able to do what you're talking about using a datagrid control, which allows you to add and edit individual columns in a row.

    Take a look at that, which might solve your problem.

  • #33937
    Profile photo of David Schmidtberger
    David Schmidtberger
    Participant

    thanks Tim, i will do so, looking at the available properties, looks more like datagridview would be closer, as it appears to allow more control of column layout, and allows editable text. will just have to play around with them a bit.

You must be logged in to reply to this topic.