Description
•VSCode Version: Code 1.19.3 (7c4205b, 2018-01-25T10:36:34.867Z)
•OS Version: Windows_NT x64 10.0.16299
•Extensions:
Author (truncated)
Version
PowerShell ms- 1.5.1
team ms- 1.122.0
Issue Description
I use the code snippet below a lot to display a windows explorer window for the selection of a input file by a end user. When debugging in VSCode the dialog box that is called is not brought to the foreground. In order to see the dialog, you need to minimize VSCode answer the dialog which returns focus back to VSCode.
Function Get-FileName($StartDirectory){
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
$openFileDialog = New-Object System.Windows.Forms.OpenFileDialog
$openFileDialog.initialDirectory = $StartDirectory
$openFileDialog.filter = "All files (.)| ."
$openFileDialog.ShowDialog() | Out-Null
$openFileDialog.filename
}