Objet PowerShellTabCollection
L’objet de collection PowerShellTab est une collection d’objets PowerShellTab. Chaque PowerShellTab fonctions d’objet en tant qu’environnement d’exécution distinct. Il s’agit d’une instance de la classe Microsoft.PowerShell.Host.ISE.PowerShellTabs. Par exemple, l’objet $psISE.PowerShellTabs
.
Méthode
Add()
Pris en charge dans Windows PowerShell ISE 2.0 et versions ultérieures.
Ajoute un nouvel onglet PowerShell à la collection. Elle retourne l’onglet nouvellement ajouté.
$newTab = $psISE.PowerShellTabs.Add()
$newTab.DisplayName = 'Brand New Tab'
Remove(Microsoft.PowerShell.Host.ISE.PowerShellTab psTab)
Pris en charge dans Windows PowerShell ISE 2.0 et versions ultérieures.
Supprime l’onglet spécifié par le paramètre psTab.
psTab l’onglet PowerShell à supprimer.
$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)
Pris en charge dans Windows PowerShell ISE 2.0 et versions ultérieures.
Sélectionne l’onglet PowerShell spécifié par le paramètre psTab pour le rendre actif sous l’onglet PowerShell actif.
psTab l’onglet PowerShell à sélectionner.
# 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