ISEAddOnToolCollection 对象

ISEAddOnToolCollection 对象是 ISEAddOnTool 对象的集合。 例如 $psISE.CurrentPowerShellTab.VerticalAddOnTools 对象。

方法

Add(Name、ControlType、[IsVisible] )

在 Windows PowerShell ISE 3.0 及更高版本中受支持,在早期版本中不存在。

向集合添加新的加载项工具。 它返回新添加的加载项工具。 运行此命令之前,必须在本地计算机上安装加载项工具并加载程序集。

名称 - 字符串指定添加到 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:\test\ISESimpleSolution\ISESimpleSolution.dll")
$psISE.CurrentPowerShellTab.VerticalAddOnTools.Add("Solutions", [ISESimpleSolution.Solution], $true)

Remove(项目)

在 Windows PowerShell ISE 3.0 及更高版本中受支持,在早期版本中不存在。

从集合中删除指定的加载项工具。

- 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 要选择的 PowerShell 选项卡。

$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)

另请参阅