Tag Archives: System.Windows.Forms

New article on PowerShell Magazine: Use Windows Forms to generate GUI messagebox

Today’s tip on PowerShell Magazine is on how to create a MessageBox using Windows.Forms in PowerShell. This allows for a popup window to appear prompting for user interaction. The full article containing tips on how to use this class is available on PowerShell Magazine : Use Windows Forms to generate GUI messagebox

To generate a GUI message box the following code can be used:

Add-Type -AssemblyName System.Windows.Forms | Out-Null
[System.Windows.Forms.MessageBox]::Show("Hello World")

For more articles like this, have a look at the External Articles section of my blog, it contains all the articles I have posted on external sources such as PowerShell Magazine.

Links in this Article
PSTip: Use Windows Forms to generate GUI messagebox
PowerShell Magazine
External Articles
Share

New article on PowerShell Magazine: Using the System.Windows.Forms.FolderBrowserDialog Class

I have been using some of the default graphic interfaces that are provided by the System.Windows.Forms Class in my scripts. The FolderBrowserDialog class can be used to create a Dialog box that allows a user to select a folder, which can in turn be used in your script. I wrote an article on this for PowerShell Magazine, you can check it out here:

http://www.powershellmagazine.com/2013/06/28/pstip-using-the-system-windows-forms-folderbrowserdialog-class/

 

Share

New article on PowerShell Magazine: Using the System.Windows.Forms.OpenFileDialog Class

The System.Windows.Forms.OpenFileDialog Class can be used to create a dialog which allows a user to select a single file or multiple files. This allows for a quick method of user interaction with a script. The selected file or list of files is returned as an object to the script and can be used for further automation.

To read more on this subject head over to my article on PowerShell Magazine:

http://www.powershellmagazine.com/2013/07/01/pstip-using-the-system-windows-forms-openfiledialog-class/

Share