PowerShell GUI running under WinPE

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.
Locked
User avatar
PGomersall
Posts: 90
Joined: Sun Mar 03, 2013 12:40 pm

PowerShell GUI running under WinPE

Post by PGomersall » Wed Feb 05, 2014 1:00 pm

Hi all,
I have built a very nice PowerShell GUI in Studio 2012 that acts as a UI for DISM. It works flawlessly in Windows. If I run it in WinPE (which is the primary reason I built it) openfiledialog, savefiledialog and folderbrowserdialog will not work; when I click the buttons to raise them? The underlying form is opened via a ps1 file.
This is 64 bit WinPE v5 with what I believe is all required dependences add to PE.
If anyone can shed any light on this I would appreciate it.
Regards,
Pete

User avatar
Alexander Riedel
Posts: 7023
Joined: Tue May 29, 2007 4:43 pm

Re: PowerShell GUI running under WinPE

Post by Alexander Riedel » Wed Feb 05, 2014 2:15 pm

I don't think the common dialogs are available in WinPE, but you will have to verify that with Microsoft.
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
PGomersall
Posts: 90
Joined: Sun Mar 03, 2013 12:40 pm

Re: PowerShell GUI running under WinPE

Post by PGomersall » Wed Feb 05, 2014 2:38 pm

I found the problem with the open and save dialogs:
If a WinForms application running on Windows PE calls “OpenFileDialog.ShowDialog” or “SaveFileDialog.ShowDialog” the call fails unless one sets the property “AutoUpgradeEnabled” to “false” before calling “ShowDialog”.

I just need to find a fix for getting the folderbrowserdialog to show the tree.
Regards,
Pete

Locked