Condividi tramite


L'oggetto PowerShellTabCollection

L'oggetto di raccolta PowerShellTab è una raccolta di oggetti PowerShellTab . Ogni oggetto PowerShellTab funziona come un ambiente di esecuzione separato. È un'istanza della classe Microsoft.PowerShell.Host.ISE.PowerShellTabs. Un esempio è l'oggetto $psISE.PowerShellTabs .

Methods

Add()

Supportato in Windows PowerShell ISE 2.0 e versioni successive.

Aggiunge una nuova scheda PowerShell alla collezione. Restituisce la scheda appena aggiunta.

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

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

Supportato in Windows PowerShell ISE 2.0 e versioni successive.

Rimuove la scheda specificata dal parametro psTab .

  • psTab - La scheda PowerShell da rimuovere.
$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)

Supportato in Windows PowerShell ISE 2.0 e versioni successive.

Seleziona la scheda PowerShell specificata dal parametro psTab per renderla la scheda PowerShell attualmente attiva.

  • psTab - La scheda PowerShell per selezionare.
# 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

Vedere anche