Using PowerShell Tabs in the PowerShell ISE

by Sep 9, 2015

The PowerShell ISE shipping with PowerShell 3.0 and better is actually a multi-host. It can host multiple separate instances of PowerShell.

To add a new PowerShell host, press CTRL+T. And to add a new PowerShell host that is connected to a remote system via Enter-PSSession, press CTRL+SHIFT+R.

Each new PowerShell host surfaces in the PowerShell ISE as a new tab, named "PowerShell1", "PowerShell2", "PowerShell3", and so forth.

Multiple separate PowerShell hosts within the ISE are useful; for example, to test-drive code in a clean environment.

If you’d like, you can even rename the tabs, so they better illustrate what the intended purpose is:

 
PS> $psise.CurrentPowerShellTab.DisplayName = 'Testing'
 

Note however that PowerShell tabs will only be visible once you have at least two PowerShell hosts. You would need to add one by pressing CTRL+T before you’d see the name change.

Twitter This Tip! ReTweet this Tip!