El objeto PowerShellTabCollection
El objeto de colección PowerShellTab es una colección de objetos PowerShellTab. Cada objeto PowerShellTab funciona como un entorno de ejecución independiente. Es una instancia de la clase Microsoft.PowerShell.Host.ISE.PowerShellTabs. Un ejemplo es el objeto $psISE.PowerShellTabs.
Métodos
Add()
Compatible con Windows PowerShell ISE 2.0 y 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'
Quitar (Microsoft.PowerShell.Host.ISE.PowerShellTab psTab)
Compatible con Windows PowerShell ISE 2.0 y posteriores.
Elimina la pestaña especificada por el parámetro psTab.
psTab La pestaña de PowerShell que se va a eliminar.
$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)
Compatible con Windows PowerShell ISE 2.0 y posteriores.
Selecciona la pestaña de PowerShell especificada por el parámetro psTab para convertirla en la pestaña de PowerShell actualmente activa.
psTab La pestaña de PowerShell que se va a 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
Ver también
- El objeto PowerShellTab
- Propósito del modelo de objetos de secuencias de comandos ISE de Windows PowerShell
- La jerarquía del modelo de objetos ISE