I have a Powershell script that calls a browser window to select a file. When I run the script in ISE it works correctly. However, when I call it from a batch file opening the browser file causes the script to go non-responsive. The code I am calling the file with is this.
Powershell.exe –ExecutionPolicy Bypass –File “<pile path>”
The code for the Brows call is this.
$fileBrows = New-Object System.Windows.Forms.OpenFileDialog
$null = $fileBrows.ShowDialog()
Return $fileBrows.FileName
I have run the as normal and as Administrator, but this make no difference.
Any ideas?