PowerShell GUI

This topic contains 6 replies, has 4 voices, and was last updated by  Recco Bucceri 1 year ago.

  • Author
  • #54595

    Recco Bucceri

    Hey all,

    So I am busy trying to develop a GUI interface for a script, that when run on a users machine it will locate and display all the PSTs on their machine. From there it was meant to be copied to a server, where the process to import to Azure storage would begin.

    The 1st issuae i am having, is getting the actual button on the GUI to work. The idea is when you click it, the script starts in the back ground, gathers all the results and presents them onscreen.

    Once this is working, what i was planning on doing, was add a check box so that the user can decide which PSTs would be copied to the server. I havent gotten to this point yet.

    Initially i just had the script looking at the E: drive, instead of finding all the drives on a machine and scanning.

  • #54599

    Recco Bucceri

  • #54605

    Liam Fisher

    Hi Recco,

    Could you please tell us what currently happens when you press the button?


  • #54624

    Dan Potter

    delete everything under # Load XAML Objects In PowerShell

    # Load XAML Objects In PowerShell
    $xaml.SelectNodes("//*[@Name]") | %{Set-Variable -Name "WPF$($_.Name)" -Value $Form.FindName($_.Name)}
    write-host 'buttonclicked'
    $Form.ShowDialog() | out-null
    • This reply was modified 1 year ago by  Dan Potter.
    • This reply was modified 1 year ago by  Dan Potter.
  • #54655

    Recco Bucceri

    When clicking the button, i wanted it to start the Get-PSTFinder function and then present the answer in the field below the button.

    Thanks that works perfectly! I have adjusted the code so that my function can run, which works. In the meantime i was doing some research on how to find the PST files currently attached to outlook, using ComObjects, which works. So now what i am attempting to do now is find the attached PST, make a copy on the server and then remove the PST from outlook.


  • #54656

    Rob Simmers

    If you can detect only the PST's you need, then why even have a GUI? If you still want to use a GUI, consider collecting the PST information when the form starts, especially if you are using a direct COM method to get the PST's versus a long search. Here is an example that is a good starting point and shows how to fill a listbox as well: https://blogs.technet.microsoft.com/heyscriptingguy/2015/11/02/creating-pop-ups-by-using-powershell/

  • #54658

    Recco Bucceri

    Valid point, but i really want to get this right (having never done it before) and i think showing the users which files will be affected is a good idea.

    Thanks for the link!

You must be logged in to reply to this topic.