Partager via


L’objet ISEAddOnToolCollection

L’objet ISEAddOnToolCollection est une collection d’objets ISEAddOnTool . Un exemple est l’objet $psISE.CurrentPowerShellTab.VerticalAddOnTools .

Méthodes

Add( Name, ControlType, [IsVisible] )

Pris en charge dans Windows PowerShell ISE 3.0 et ultérieurs, et absent dans les versions antérieures.

Ajoute un nouvel outil complémentaire à la collection. Il renvoie l’outil complémentaire nouvellement ajouté. Avant d’exécuter cette commande, vous devez installer l’outil complémentaire sur l’ordinateur local et charger l’assemblage.

  • Nom - Chaîne - Spécifie le nom d’affichage de l’outil complémentaire ajouté à Windows PowerShell ISE.
  • TypeContrôle - Type - Spécifie le contrôle ajouté.
  • [IsVisible] - Booléen optionnel - Si défini sur $true, l’outil complémentaire est immédiatement visible dans le panneau d’outils associé.
# Load a DLL with an add-on and then add it to the ISE
[Reflection.Assembly]::LoadFile("C:testISESimpleSolutionISESimpleSolution.dll")
$psISE.CurrentPowerShellTab.VerticalAddOnTools.Add("Solutions", [ISESimpleSolution.Solution], $true)

Remove(Item)

Pris en charge dans Windows PowerShell ISE 3.0 et ultérieurs, et absent dans les versions antérieures.

Supprime l’outil complémentaire spécifié de la collection.

  • Élément - Microsoft.PowerShell.Host.ISE.ISEAddOnTool - Spécifie l’objet à supprimer de Windows PowerShell ISE.
# Load a DLL with an add-on and then add it to the ISE
[Reflection.Assembly]::LoadFile("C:\test\ISESimpleSolution\ISESimpleSolution.dll")
$psISE.CurrentPowerShellTab.VerticalAddOnTools.Add("Solutions", [ISESimpleSolution.Solution], $true)

SetSelectedPowerShellTab(psTab)

Pris en charge dans Windows PowerShell ISE 3.0 et ultérieurs, et absent dans les versions antérieures.

Sélectionne l’onglet PowerShell que le paramètre psTab spécifie.

  • psTab - Microsoft.PowerShell.Host.ISE.PowerShellTab -The onglet PowerShell pour sélectionner.
$newTab = $psISE.PowerShellTabs.Add()
# Change the DisplayName of the new PowerShell tab.
$newTab.DisplayName = 'Brand New Tab'

Remove(psTab)

Pris en charge dans Windows PowerShell ISE 3.0 et ultérieurs, et absent dans les versions antérieures.

Supprime l’onglet PowerShell que le paramètre psTab spécifie.

  • psTab - Microsoft.PowerShell.Host.ISE.PowerShellTab - 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)

Voir aussi