Tag Archives: Windows Forms

Powershell Open File Dialog Box

Do you ever require the users of your script to select which file to use?

I do. And it’s no fun trying to do decent error-handling when a user has to type the full path to a file. Nor is it any fun to be that user. So why not use the Windows Forms class of .Net to show the Open File Dialog Box?

Select-FileDialog function (rename to .ps1 or copy into your profile)

User happy. Me happy. You happy?