Edit-File using the PowerShell 3.0 ISE?

Topics: User Forum
Mar 13, 2013 at 5:42 PM
What's the anticipated mechanism to make Edit-File work well with the ISE editor in PSCX 3.0?

Can I do this simply by changing the editor preference variable, or do I need to replace the Edit-File function?
Mar 13, 2013 at 6:22 PM
Just change the editor pref variable from notepad.exe to powershell_ise.exe.
Jan 22, 2014 at 9:08 PM
Edited Jan 22, 2014 at 9:10 PM
This works well most of the time, but in cases where I've got more than one instance powershell_ise.exe running, it sometimes opens the editor in the wrong instance.

It seems like there ought to be a way to use $PSISE.CurrentPowerShellTab to open a file, but I'm not finding it. Am I missing something?
Apr 10, 2014 at 2:45 AM
Try $PSISE.CurrentPowerShellTab.Files.Add($filename) to open a file in the current ISE