Upon opening PSScriptPad, it shows the error "Object reference not set to an instance of an object" in the bottom console pane (screenshot below). The best way to try ...
Only when run from within PSScriptPad, a WinForm script will crash if the OpenFileDialog control is invoked. It is important to note that the resulting code works fine outside of PSScriptPad. Build a ...