This project is read-only.

Close All But This

Feb 21, 2009 at 1:30 PM
I want to be able to close all the tabs in the ISE editor except the one I am currently in.

I have looked at the objects on $psISE and don't see a Close() method but do see a DisplayName.

Anyone know how to do this?

Feb 26, 2009 at 7:23 AM
I think the best way is to send a suggestion to Even if there where work arounds, the object model would be incomplete. I'm just missing a function to determine whether a shortcut is already in use.
Feb 26, 2009 at 11:15 AM
Editor.focus() does not switch the tab. Something that switches to a specific tab is needed too.
Feb 27, 2009 at 9:12 PM
Edited Feb 27, 2009 at 9:13 PM
The basic methods are
$psIse.CurrentOpenedRunspace.OpenedFiles.Remove( $openFile) 
I have allready a function to close the current editor or any editor specified by an index. I hope to add a switch tomorrow to close all but the current or any specified editor tab tomorrow.
To find the undokumented functions:
$psIse.CurrentOpenedRunspace.OpenedFiles.PSBase | gm

Feb 28, 2009 at 1:09 PM
Edited Feb 28, 2009 at 1:09 PM
Hello Doug, just added Close-ISETab. Your Problem is solved.
Feb 28, 2009 at 1:20 PM
Thanks Bernd. I'll give it a try.

I'll also post a suggestion on connect.