当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] ISEAddOnToolCollection 对象

作者:精品下载站 日期:2024-12-14 20:29:36 浏览:12 分类:玩电脑

ISEAddOnToolCollection 对象


ISEAddOnToolCollection 对象是 ISEAddOnTool 对象的集合。一个示例是 $psISE.CurrentPowerShellTab.VerticalAddOnTools 对象。

方法

添加(名称,控制类型,[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)

删除(项目)

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

设置选定的PowerShellTab( 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'

删除(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)

参见

  • PowerShellTab 对象
  • Windows PowerShell ISE 脚本对象模型的用途
  • ISE 对象模型层次结构

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯