ISEAddOnToolCollection 物件是一組 ISEAddOnTool 物件的集合。 例如物件。$psISE.CurrentPowerShellTab.VerticalAddOnTools
Methods
Add( Name, ControlType, [IsVisible] )
支援於 Windows PowerShell ISE 3.0 及以上版本,且早期版本中不存在此功能。
新增一個附加工具到收藏中。 它會回傳新加入的附加工具。 在執行此指令之前,您必須在本地電腦安裝附加工具並載入組裝。
- Name - String - 指定新增到 Windows PowerShell ISE 的附加元件工具的顯示名稱。
- ControlType - Type - 指定新增的控制項。
-
[IsVisible] - 可選的布林值 - 若設定為
$true,附加工具會立即在相關工具窗中顯示。
# 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)
支援於 Windows PowerShell ISE 3.0 及以上版本,且早期版本中不存在此功能。
移除指定的附加工具。
- Item - Microsoft.PowerShell.Host.ISE.ISEAddOnTool - 指定要從 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)
支援於 Windows PowerShell ISE 3.0 及以上版本,且早期版本中不存在此功能。
選擇 psTab 參數指定的 PowerShell 分頁。
- psTab - Microsoft.PowerShell.Host.ISE.PowerShellTab -The PowerShell tab to select.
$newTab = $psISE.PowerShellTabs.Add()
# Change the DisplayName of the new PowerShell tab.
$newTab.DisplayName = 'Brand New Tab'
Remove(psTab)
支援於 Windows PowerShell ISE 3.0 及以上版本,且早期版本中不存在此功能。
移除 psTab 參數指定的 PowerShell 分頁。
- psTab - Microsoft.PowerShell.Host.ISE.PowerShellTab - 用來移除的 PowerShell 標籤。
$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)