I have the following code which should allow a user to pick a folder location for a specific file and then I will use that location to take action on the file. However, when I run the script outside of the ISE the FolderBrowserDialog doesn't appear at all. I have looked behind the powershell window and behind all other windows and it never appears.
Add-Type -AssemblyName System.Windows.Forms
$FolderBrowser = New-Object System.Windows.Forms.FolderBrowserDialog
$FolderBrowser.Description = "Description"
$FolderBrowser.ShowNewFolderButton = $false
$FolderBrowser.RootFolder = 'MyDocuments'
if($FolderBrowser.ShowDialog() -eq $true){
Do some stuff
}
Any thoughts on why it might not show up? Are there certain powershell settings that need to be turned on to have things appear from the console?