El objeto PowerShellTabCollection

El objeto de colección PowerShellTab es una colección de objetos PowerShellTab. Cada objeto PowerShellTab funciona como un entorno de runtime independiente. Es una instancia de la clase Microsoft.PowerShell.Host.ISE.PowerShellTabs. Un ejemplo es el objeto $psISE.PowerShellTabs.

Métodos

Add()

Se admite en Windows PowerShell ISE 2.0 y versiones posteriores.

Agrega una nueva pestaña de PowerShell a la colección. Devuelve la pestaña recién agregada.

$newTab = $psISE.PowerShellTabs.Add()
$newTab.DisplayName = 'Brand New Tab'

Remove(Microsoft.PowerShell.Host.ISE.PowerShellTab psTab)

Se admite en Windows PowerShell ISE 2.0 y versiones posteriores.

Quita la pestaña especificada por el parámetro psTab.

psTab Pestaña de PowerShell que se quitará.

$newTab = $psISE.PowerShellTabs.Add()
Change the DisplayName of the new PowerShell tab.
$newTab.DisplayName = 'This tab will go away in 5 seconds'
sleep 5
$psISE.PowerShellTabs.Remove($newTab)

SetSelectedPowerShellTab(Microsoft.PowerShell.Host.ISE.PowerShellTab psTab)

Se admite en Windows PowerShell ISE 2.0 y versiones posteriores.

Selecciona la pestaña de PowerShell especificada por el parámetro psTab para que sea la pestaña activa de PowerShell.

psTab Pestaña de PowerShell que se seleccionará.

# Save the current tab in a variable and rename it
$oldTab = $psISE.CurrentPowerShellTab
$psISE.CurrentPowerShellTab.DisplayName = 'Old Tab'
# Create a new tab and give it a new display name
$newTab = $psISE.PowerShellTabs.Add()
$newTab.DisplayName = 'Brand New Tab'
# Switch back to the original tab
$psISE.PowerShellTabs.SelectedPowerShellTab = $oldTab

Consulte también