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

[玩转系统] ISESnippetCollection 对象

作者:精品下载站 日期:2024-12-14 02:59:40 浏览:14 分类:玩电脑

ISESnippetCollection 对象


ISESnippetCollection 对象是 ISESnippet 对象的集合。与 PowerShellTab 对象关联的文件集合是此类的成员。一个示例是 $psISE.CurrentPowerShellTab.Files 集合。

方法

加载(文件路径名)

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

加载包含用户定义代码段的 .snippets.ps1xml 文件。创建代码段的最简单方法是使用 New-IseSnippet cmdlet,它会自动将它们存储在您的配置文件文件夹中,以便您每次启动 Windows PowerShell ISE 时都会加载它们。

FilePathName - 字符串 包含代码段定义的 .snippets.ps1xml 文件的路径和文件名。

# Loads a custom snippet file into the current PowerShell tab.
$SnipFile = Join-Path ( Split-Path $profile) 'Snippets\MySnips.snippets.ps1xml' $psISE.CurrentPowerShellTab.Snippets.Add($SnipPath)

参见

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

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

取消回复欢迎 发表评论:

关灯