Reopen last used tabs in Powershell ISE

Hi Scripting Guys
I use a lot of tabs in Powershell ISE console in my work, as an Administrator, and every time I close the ISE I need to reopen every tabs that I used before. So my question is:
When I open Powershell ISE can it automatically reopen last tabs, that I used? Can Powershell ISE remember that last used tabs like IE can remember last open browser session?
Best regards,
Thorkell

Hi,
I do this by killing the ISE process with process explorer instead of closing the window. The next time you open the ISE it will note that it didn't shut down properly and will reopen the tabs you had open previously.
I'm not aware of a graceful way to do this though.
Don't retire TechNet! -
(Don't give up yet - 12,830+ strong and growing)
kill $PID -Force
I've done this a few times to keep my tabs when I open up ISE another time. :)
Boe Prox
Blog |
Twitter
PoshWSUS |
PoshPAIG | PoshChat |
PoshEventUI
PowerShell Deep Dives Book

Similar Messages

  • Tabs d0 not close on exit; when restarted, last-used tabs automatically open. How to I close ALL TABS on exit so that nothing re-opens when Firefox 4 is started?

    All last-used tabs remain "visible" and do not close automatically on exit from Firefox 4. This means that when a new session is started, the last-used tab (website) automatically opens. How can ALL TABS be closed on exit from Firefox?

    Go to Tools | Add-ons | Plugins ans disable "My Web Search". This program is spyware and will cause you all sorts of problems. After you disable it, go to Add/Remove Programs and uninstall it.
    Also, see [https://support.mozilla.com/en-US/kb/How%20to%20set%20the%20home%20page?s=home+page&as=s#w_set-what-pages-open-when-firefox-starts Set what pages open when Firefox starts]

  • Last Used Tabs, History, etc from Mobile to Desktop

    I know you can sync between desktop and mobile, but is it possible to sync mobile to desktop? Like start browsing on my mobile and then continue on my desktop. Is it possible to do that?

    Hi!
    Indeed, if you are using Firefox on Android or Maemo this is an option. Your tabs will automatically synced from your mobile device to your desktop browser. Just look for them in "History -> Tabs from other computers".
    Unfortunately this is not possible yet if you are using Fx Home in your iOS device.

  • Powershell ISE – change indent/tab size + keep tabs

    Anyway to change indent/tab size in Powershell ISE?
    Something simple like in Visual studio IDE:
    Tab size 2
    Indent size 2
    Keep tabs

    Figured I'd share the changes I made to NoSimDash's above code. I actually wrote this not long after he posted his reply, but decided not to post it after I settled on taking the cheap, hacky timer route. (Originally I was looking to have the process triggered
    by an event when the user changed tabs)
    Anyways, over the last two years it's been pretty stable, so I thought I'd share on the off-chance that someone goes looking for this functionality again.
    $psISE.Options.ShowOutlining = $true
    $psISE.Options.ShowDefaultSnippets = $true
    $psISE.Options.ShowIntellisenseInScriptPane = $true
    $psISE.Options.ShowIntellisenseInConsolePane = $true
    Set-Variable -Option AllScope -Name OptionSetter -Value (&{
    $ClassName = 'IndentFixer'
    $Namespace = 'ISEHijack'
    Add-Type @"
    internal class _Option<TValue>
    public _Option(string key, TValue value)
    Key = key;
    Value = value;
    public Object[] Params { get { return new object[] { Key, Value }; } }
    public string Key { get; private set; }
    public TValue Value { get; private set; }
    internal static object[] Opt<TVal>(string key, TVal value)
    return new _Option<TVal>(key, value).Params;
    internal static readonly object[][] NewOpts = {
    Opt<bool>("Adornments/HighlightCurrentLine/Enable", false),
    Opt<int>("Tabs/TabSize", 4),
    Opt<int>("Tabs/IndentSize", 4),
    Opt<bool>("Tabs/ConvertTabsToSpaces", false),
    Opt<bool>("TextView/UseVirtualSpace", false),
    Opt<bool>("TextView/UseVisibleWhitespace", true)
    internal void SetOpts()
    foreach(object[] args in NewOpts) {
    Setter.Invoke(Options, args);
    public MethodInfo Setter { get; set; }
    public object Options { get; set; }
    public Dispatcher EditorDispatcher { get; set; }
    public List<Action> Actions { get; private set; }
    public ${ClassName}()
    Actions = new List<Action>();
    Actions.Add(SetOpts);
    public void Dispatch(Dispatcher dispatcher)
    DispatcherFrame frame = new DispatcherFrame();
    dispatcher.BeginInvoke(DispatcherPriority.Normal, new DispatcherOperationCallback(ExitFrames), frame);
    Dispatcher.PushFrame(frame);
    private object ExitFrames(object f){
    DispatcherFrame frame = ((DispatcherFrame)f);
    // foreach(Action action in Actions) {
    // action.Invoke();
    // Actions.Clear();
    foreach(object[] args in NewOpts) {
    Setter.Invoke(Options, args);
    frame.Continue = false;
    return null;
    "@ -Name $ClassName `
    -NameSpace $Namespace `
    -UsingNamespace System.Windows.Forms,System.Windows.Threading,System.Reflection,Microsoft.VisualStudio.Text.EditorOptions.Implementation,System.Collections.Generic `
    -ReferencedAssemblies WindowsBase,System.Windows.Forms,Microsoft.PowerShell.Editor
    return `
    "${Namespace}.${ClassName}" |
    Add-Member -Type NoteProperty -Name Namespace -Value $Namespace -Passthru |
    Add-Member -Type NoteProperty -Name ClassName -Value $ClassName -Passthru
    [System.Reflection.BindingFlags] $NonPublicFlags = [System.Reflection.BindingFlags] 'NonPublic,Instance'
    filter Expand-Property
    PARAM(
    [Alias('Property')]
    [ValidateNotNullOrEmpty()]
    [Parameter(Mandatory, Position=0)]
    [String] $Name
    $_ | Select-Object -ExpandProperty $Name | Write-Output
    function Get-IsePrefs
    PARAM(
    [Parameter(Mandatory, Position=1)]
    [ValidateNotNullOrEmpty()]
    [string] $Key
    $oEditor = $psISE.CurrentFile.Editor
    $tEditor = $oEditor.GetType()
    $tEditor.GetProperty('EditorOperations', $NonPublicFlags).GetMethod.Invoke($oEditor, $null).Options | `
    Expand-Property GlobalOptions | `
    Expand-Property SupportedOptions | `
    Select-Object -Property Key,ValueType,DefaultValue | `
    Write-Output
    function Comment-Selection
    $output = ''
    $psISE.CurrentFile.Editor.SelectedText.Split("`n") | ForEach-Object -Process { $output += "# " + [string]$_ + "`n" }
    $psISE.CurrentFile.Editor.InsertText($output)
    function Fix-EditorIndentation
    PARAM(
    [Alias('ISEEditor')][ValidateNotNull()]
    [Parameter(Mandatory, ValueFromPipeline, Position=1)]
    [Microsoft.PowerShell.Host.ISE.ISEEditor]
    $Editor
    $EditorType = $Editor.GetType()
    $SetterInstance = New-Object -TypeName $OptionSetter
    $SetterInstance.Options = $EditorType.GetProperty('EditorOperations', $NonPublicFlags).GetMethod.Invoke($Editor, $null).Options
    $Dispatcher = $EditorType.GetProperty('EditorViewHost', $NonPublicFlags).GetMethod.Invoke($Editor, $null).Dispatcher
    $SetterInstance.Setter = $SetterInstance.Options.GetType().GetMethod('SetOptionValue', [type[]]@([string],[object]))
    $SetterInstance.Dispatch($Dispatcher)
    function Fix-IseIndentation
    [Microsoft.Windows.PowerShell.Gui.Internal.MainWindow] $ISEWindow = (Get-Host | Select-Object -ExpandProperty PrivateData | Select-Object -ExpandProperty Window)
    [Microsoft.Windows.PowerShell.Gui.Internal.RunspaceTabControl] $RSTabCtrl = $ISEWindow.Content[0].Children[2]
    [Microsoft.PowerShell.Host.ISE.PowerShellTab] $PSTab = $RSTabCtrl.Items[0]
    $PSTab.Files | Select-Object -ExpandProperty Editor | Fix-EditorIndentation
    function Invoke-ISEFunction
    PARAM(
    [Parameter(Mandatory, Position=1)]
    [Action] $ScriptBlock
    $ISEWindow = $(Get-Host | Select-Object -ExpandProperty PrivateData | Select-Object -ExpandProperty Window)
    return $ISEWindow.Dispatcher.Invoke($ScriptBlock)
    function Fix-IndentationForAll
    $psISE.PowerShellTabs | Select-Object -ExpandProperty 'Files' | Select-Object -ExpandProperty 'Editor' | Fix-EditorIndentation
    # Startup
    function New-Timer
    PARAM(
    [Alias('Handler')]
    [Parameter(Position=0, Mandatory=$true)]
    $Action,
    [Double]
    [Parameter(Mandatory=$false)]
    $Interval = 50,
    [Boolean]
    [Parameter(Mandatory=$false)]
    $AutoReset = $true
    [System.Timers.Timer] $oTimer = New-Object -TypeName System.Timers.Timer($Interval)
    $ElapsedEvent = Register-ObjectEvent -InputObject $oTimer -EventName 'Elapsed' -Action $Action
    $oTimer.AutoReset = $AutoReset
    return $oTimer
    $(New-Timer {
    Fix-IndentationForAll
    } -Interval 100 -AutoReset $true).Start()

  • My browser suddenly always opens on the page it was on when it was shut down last and uses tabs even though I have them turned off. I have tried reinstalling.

    I have my browser set to open on comcast.net webpage and to never use tabs. I have been using firefox for years and am very familiar with it. Suddenly it has started opening on the last page it was on when shut down, and has started using tabs. When I delete Firefox from my computer, it still remembers all my settings. I had this problem once before years ago and ended up having to wipe my entire drive to fix it. I would like to avoid a drive wipe this time. I need to know how to get ALL of the browsers information deleted from the registry so I can get a truly fresh install. And yes, I have tried all the normal avenues and am pretty computer savvy. Please help before I go nuts. I am running the most recent version, but going back to older versions didn't help either. Thanks.
    Bob Smith

    Another possibility is that Firefox keeps crashing during shutdown, and so Firefox is recovering from a crash every time. To diagnose this, you can change how Firefox recovers from a crash: instead of restoring the previous session, it will show a list of what you had open so you can be selective or bypass it altogether.
    Here's where you change that:
    (1) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the search box above the list, type or paste '''sess''' and pause while the list is filtered
    (3) Double-click the '''browser.sessionstore.max_resumed_crashes''' preference and change the value from 1 to 0 and OK that.
    ''Note: Please don't change any other sessionstore preferences without researching them first.''

  • I use "firefox -new-tab anyPage.html" but it does not open it in new tab. Instead it replaces the last active tab.

    Well I use following command to view offline pages using firefox on my linux box
    $ firefox -new-tab anyPage.html
    But instead of opening it in new tab, it replaces the last active tab.
    I have tired
    $ firefox -new-tab anyPage.html &
    $ firefox -remote "openurl(anyPage.html,NEW_TAB)"
    But none works.
    Sometimes it do open in new tab but mostly it does not. I have been unable to figure out any pattern.
    == This happened ==
    Every time Firefox opened

    (''Note: cross posted from [https://support.mozilla.com/nl/questions/801471 here].'')
    I had the same problem, but was able to fix it somewhat.
    # Open the about:config page.
    # Set the ''browser.link.open_newwindow.restriction'' setting to 0 (= zero).
    On my machine this will open new windows in a new tab. However, it switches to the new tab regardless of the setting ''"When I open a link in new tab, switch to it immediatly"''.

  • Using PowerShell ISE on Exchange Edge Server

    I need manage edge servers from PowerShell ISE to create a script. I tried the steps mentioned on TechNet, but they give an error due to Kerberos not being usable on a workgroup computer.
    Any ideas how I can manage to do this without much tinkering?
    TechNet Article that doesn't work with Edge server:
    http://technet.microsoft.com/en-us/library/dd335083(v=exchg.150).aspx

    Hi,
    According to the description, I notice that you are using workgroup computer.
    If you are using workgroup computer, based on my knowledge, it seems impossible to apply Edge settings.
    If you have Script requirement, I suggest ask Script Center for help, so that you can get more professional suggestions. For your convenience:
    http://technet.microsoft.com/en-us/scriptcenter/dd742246.aspx
    Thanks 
    Mavis Huang
    TechNet Community Support

  • Powershell - site collections, size, owner, last used etc

    Hi All,
    I know its out there, as I've used something similar, albeit needing fewer info than requested, but I need to be able to provide all site collections in a farm, size, last used, owner and a bit more, which cannot remember, but if someone can point me in
    the right direction I have something to build on
    Thanks

    AG9,
    Please have these script for those reports
    Windows
    PowerShell Script to Output Site Collection Information
    FIND
    ALL SHAREPOINT 2010 SITE COLLECTIONS AND THEIR SIZES USING POWERSHELL
    Hope the are helpfull
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • I was able to set Firefox 3.5 to reopen all the tabs which were closed when exited Firefox. I cannot do it with Firefox 3.6.

    I use Firefox 3.6.2 on a 2009 MAC Pro using OSX 10.6.5.
    Before upgrading to Firefox 3.6 I was able to configure Firefox 3.5 to reopen all the tabs which had been closed during exiting Firefox prior to reopening it.
    I am unable to configure Firefox 3.6 to do the same.
    Now, when I open Firefox it always opens with one tab with my homepage. It would be much more convenient for me to have all the tabs which had been opened to reopen. When I change a plug-in in order to the change to take effect I have to exit and reopen Firefox, thus losing all the open tabs.

    If you use [[Clear Recent History]] in Firefox 3.5 and later to clear the 'Browsing History' when you close Firefox then restoring tabs from the last session ("Save & Quit" or "Show my windows and tabs from last time") doesn't work.

  • Powershell ISE bugs?

    Using PowerShell 3.0 ISE on Windows Server 2008 R2 with the latest service pack. Copy and paste within a PowerShell ISE window or between windows or from the ISE to anything else only works intermittently. There is no other copy and past problem on the servers.
    Also when I modify a PS script and run it Powershell often runs the previous version of the script. Some times I have to save AND close AND reopen to get the revised script instead of the original script to run.
    Is this just my servers?
    carpe cras

    There is a Connect issue reported for Cut, probably could roll this one up into this by adding a comment and voting on it. If you don't think it is related enough, you can always open up a new Connect item as well.
    https://connect.microsoft.com/PowerShell/feedback/details/777187/ctrl-x-cut-keyboard-shortcut-stops-working-in-powershell-ise-after-a-while
    Boe Prox
    Blog |
    PoshWSUS | PoshPAIG |
    PoshChat

  • I can't open last closed tab, doesn't start with last tabs

    I recently noticed that I cannot open the last closed tab (the selection is there, but is greyed out).
    Then, when rebooting, I notice that the system does not restore the last visited tabs - even though that selection is made in the Options.
    I recently installed KeePass and it's extension in Firefox and it seems to work well (I don't actually use it often). And, recently I had a glitch where the system would resize my pages (as if I was holding the Ctrl key down while scrolling.
    Several reboots fixed this issue - but now I can't resize by holding the Ctrl key and scrolling (although holding Ctrl and tapping the - key will resize the window).
    Any ideas on how to fix this without a total reinstall? I've been copying my Firefox profile from one computer to another for years and am concerned about losing my saved data/preferences.
    Thanks in advance!!!
    - John

    Uninstalled KeeFox and the problem has disappeared.

  • When closing Firefox, after reopening it, my tabs are gone, even though I have Firefox set to remember session.

    When closing Firefox, after reopening it, my tabs are gone, even though I have Firefox set to remember session. However, after several hours and opening and closings of Firefox, it will open tabs from the old session, for no apparent reason.

    You can check for problems with the sessionstore.js and sessionstore.bak files in the Firefox profile folder that store session data.
    Delete the sessionstore.js file and possible sessionstore-##.js files with a number and sessionstore.bak in the Firefox profile folder.
    *Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder)
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    *http://kb.mozillazine.org/Multiple_profile_files_created
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost and you will have to recreate them (make a note or bookmark them if possible).
    In case you are using "Clear history when Firefox closes":
    *do not clear the Browsing History
    *Tools > Options > Privacy > Firefox will: "Use custom settings for history": [X] "Clear history when Firefox closes" > Settings
    *https://support.mozilla.org/kb/Clear+Recent+History
    Note that clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, and passwords.

  • How to change gtk theme dialog box button appearance when using tab?

    Hi,
    I'm using candido as my gtk theme and have noticed that when a dialog box pops up (Yes / No), it is extremely difficult to tell which option is highlighted. How do I change this appearance? I searched through the gtkrc and even used gimp to manipulate the images used via trial and error to see if I found one that worked. Can someone familiar with gtk themes tell me which gtkrc or image to alter to affect this appearance?
    I use tab to select my option a ton and hate not being able to tell what I'm looking at.
    For reference,
    - here is the current look (can you tell which one is highlighted? It's "Cancel" -- just slightly bigger or a fine line around it) LINK
    - here is the gtkrc if that helps? LINK
    For one more point of clarification, I'm not talking about the button appearance on mouseover. I have identified that the button-prelight.png file changes that. I specifically am talking purely about a dialog popping up and then using the tab key alone to highlight through the options. I really like this theme, but this one thing drives me crazy. This appearance changes when I select different themes with lxappearance, so I've narrowed it down to being a gtk-theme issue, not my openbox theme or icon set.
    Many thanks!
    Last edited by jwhendy (2011-02-02 18:11:10)

    HI,
    Debug the program after you press the CANCEL button , you will get where the conrol is flowing , And instead of using
    Leave to screen '910'          use               Leave to screen 0.
    Regards,
    Madhukar Shetty

  • Help with disabling close icon of last opened tab in JTabbedPane

    Hello
    Would someone help me out ? I have 3 tabs opened in a JTabbedPane, each with close icon "X". I am looking for a way to tell my program: if the user closes 2 tabs and only 1 remain, disable the close icon "X" of the last opened tab so that the user is unable to close the last tab. I have searched the forum, most I have run into are how to create the close icon. Would someone give me some insight into how to go about doing this? or if you have come across a forum that discusses this, do please post the link. Also, I am using java 1.6.
    Thanks very much in advance

    On each close, look how many tabs are remaining open in the JTabbedPane (getTabCount).
    If there is only one left, set its close button to invisible. Something like this:
    if (pane.getTabCount() == 1) {
        TabCloseButton tcb = (TabCloseButton) pane.getTabComponentAt(0);
        tcb.getBtClose().setVisible(false);
    }

  • Reopened last closed window is greyed out

    Hi there,
    I recently bought my first Apple notebook - a 15 inch Macbook Pro running OS-X Mavericks. I am running Safari 7.0.2 and am new to Safari. I find that the "Reopened Last Closed Window" option is greyed out. I have searched online communities and deleted plists and rebooted my machine; nothing gives unfortunately.
    Please could you help?
    Thanks,
    Vinayak

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of this test is to determine whether the problem is localized to your user account. Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault in OS X 10.7 or later, then you can’t enable the Guest account. The "Guest User" login created by "Find My Mac" is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.

Maybe you are looking for

  • Where is the CML Personal version?

    I have had people asking where is the personal version, why isn't it available, why did we say it was coming and change, and so on. Below is an explanation with a little history to explain what happened and why. For those reaching out to me directly

  • CS2 Doc Converted to CS3 takes 2+ Minutes to Open Every Time

    We are in the process of switching 34 users from ID CS2 to ID CS3 and are having file conversion nightmares. They need to re-use their old CS2 ad layouts but many users are complaining that the conversion to CS3 takes several minutes. In our test per

  • Group and Individual Assets Legacy data load

    Hi, I work for a oil and gas company and I am having issues for the initial load for the group and individual assets into SAP . Any help in regards to this would be helpful. Below are the values that I would like to load into SAP for group ( grp 1 ) 

  • Handling SOAP fault message

    Hi, My scenario is Client sync proxy to webservice. I have done the mapping from zreuest ->Webservice Request  and webservice Resp -> zresponse. Now, when i am calling the webservice getting the following Error message on XI *Inbound Message:* <?xml

  • Business Area reallocation

    Dear Experts, I am facing a problem in business area. At the time of entry, I dont know which business area it should post. I will select one business area. At period end, is it possible to reallocate values from one business area to another business