我们在使用PowerShell脚本的时候,帮助文档特别的重要。除了能在PowerShell的控制台中查看帮助信息外,我们还能借助于第三方工具,进行PowerShell帮助文档的查看;总的来说有三种。

@ 能以图形化方式列出所有可用的帮助主题。

大家可以到下面这个网站

https://gallery.technet.microsoft.com/ScriptCenter/ea76e9dd-e6bf-4750-b1a2-de0a0a649797/

把当前的PowerShell脚本复制并另存为PS_Help_About.ps1,然后运行这个脚本,就会看到下面的帮助文档。

脚本如下:

function Add-Node { param ( $selectedNode, $name, $tag ) $newNode = new-object System.Windows.Forms.TreeNode  $newNode.Name = $name $newNode.Text = $name $newNode.Tag = $tag $selectedNode.Nodes.Add($newNode) | Out-Null return $newNode
} function Get-HelpTree { if ($script:cmdletNodes)  {  $treeview1.Nodes.remove($script:cmdletNodes) $form1.Refresh() } $script:cmdletNodes = New-Object System.Windows.Forms.TreeNode $script:cmdletNodes.text = "PowerShell Help" $script:cmdletNodes.Name = "PowerShell Help" $script:cmdletNodes.Tag = "root" $treeView1.Nodes.Add($script:cmdletNodes) | Out-Null $treeView1.add_AfterSelect({ if ($this.SelectedNode.Tag -eq "Cmdlet") { $helpText = Get-Help $this.SelectedNode.Name -Full $richTextBox1.Text = $helpText | Out-String $linkLabel1.Text = $helpText.relatedLinks.navigationLink[0].uri $form1.refresh() } else { $richTextBox1.Text = "Example to show how to use TreeView control in PowerShell script" $linkLabel1.Text = "http://www.ravichaganti.com/blog" } }) #Generate Module nodes $modules = @("Microsoft.PowerShell.Core","Microsoft.PowerShell.Diagnostics","Microsoft.PowerShell.Host","Microsoft.PowerShell.Management","Microsoft.PowerShell.Security","Microsoft.PowerShell.Utility") $modules | % { $parentNode = Add-Node $script:cmdletNodes $_ "Module" $moduleCmdlets = Get-Command -Module $_ $moduleCmdlets | % { $childNode = Add-Node $parentNode $_.Name "Cmdlet" } } $script:cmdletNodes.Expand()
} #Generated Form Function
function GenerateForm {
########################################################################
# Code Generated By: SAPIEN Technologies PrimalForms (Community Edition) v1.0.7.0
# Generated On: 3/2/2010 5:46 PM
# Generated By: Ravikanth Chaganti (http://www.ravichaganti.com/blog)
######################################################################## #region Import the Assemblies
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null
#endregion #region Generated Form Objects
$form1 = New-Object System.Windows.Forms.Form
$linkLabel1 = New-Object System.Windows.Forms.LinkLabel
$label4 = New-Object System.Windows.Forms.Label
$label3 = New-Object System.Windows.Forms.Label
$label2 = New-Object System.Windows.Forms.Label
$button1 = New-Object System.Windows.Forms.Button
$richTextBox1 = New-Object System.Windows.Forms.RichTextBox
$treeView1 = New-Object System.Windows.Forms.TreeView
$InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState
#endregion Generated Form Objects #----------------------------------------------
#Generated Event Script Blocks
#----------------------------------------------
#Provide Custom Code for events specified in PrimalForms.
$button1_OnClick=
{
$form1.Close() } $OnLoadForm_StateCorrection=
{Get-HelpTree
} $linkLabel1_OpenLink=
{ [system.Diagnostics.Process]::start($linkLabel1.text)
}
#----------------------------------------------
#region Generated Form Code
$form1.Text = "Primal Form"
$form1.Name = "form1"
$form1.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 838
$System_Drawing_Size.Height = 612
$form1.ClientSize = $System_Drawing_Size $linkLabel1.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",9,0,3,0)
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 539
$System_Drawing_Size.Height = 23
$linkLabel1.Size = $System_Drawing_Size
$linkLabel1.TabIndex = 10
$linkLabel1.Text = "http://www.ravichaganti.com/blog"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 253
$System_Drawing_Point.Y = 541
$linkLabel1.Location = $System_Drawing_Point
$linkLabel1.TabStop = $True
$linkLabel1.DataBindings.DefaultDataSourceUpdateMode = 0
$linkLabel1.Name = "linkLabel1"
$linkLabel1.add_click($linkLabel1_OpenLink) $form1.Controls.Add($linkLabel1) $label4.TabIndex = 9
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 136
$System_Drawing_Size.Height = 23
$label4.Size = $System_Drawing_Size
$label4.Text = "Cmdlet Help URI"
$label4.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",9,1,3,0) $System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 253
$System_Drawing_Point.Y = 518
$label4.Location = $System_Drawing_Point
$label4.DataBindings.DefaultDataSourceUpdateMode = 0
$label4.Name = "label4" $form1.Controls.Add($label4) $label3.TabIndex = 6
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 100
$System_Drawing_Size.Height = 23
$label3.Size = $System_Drawing_Size
$label3.Text = "Description"
$label3.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",9,1,3,0) $System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 255
$System_Drawing_Point.Y = 37
$label3.Location = $System_Drawing_Point
$label3.DataBindings.DefaultDataSourceUpdateMode = 0
$label3.Name = "label3" $form1.Controls.Add($label3) $label2.TabIndex = 5
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 177
$System_Drawing_Size.Height = 23
$label2.Size = $System_Drawing_Size
$label2.Text = "PowerShell Help Tree"
$label2.Font = New-Object System.Drawing.Font("Microsoft Sans Serif",9,1,3,0) $System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 13
$System_Drawing_Point.Y = 13
$label2.Location = $System_Drawing_Point
$label2.DataBindings.DefaultDataSourceUpdateMode = 0
$label2.Name = "label2" $form1.Controls.Add($label2) $button1.TabIndex = 4
$button1.Name = "button1"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 75
$System_Drawing_Size.Height = 23
$button1.Size = $System_Drawing_Size
$button1.UseVisualStyleBackColor = $True $button1.Text = "Close" $System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 253
$System_Drawing_Point.Y = 577
$button1.Location = $System_Drawing_Point
$button1.DataBindings.DefaultDataSourceUpdateMode = 0
$button1.add_Click($button1_OnClick) $form1.Controls.Add($button1) $richTextBox1.Name = "richTextBox1"
$richTextBox1.Text = ""
$richTextBox1.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 255
$System_Drawing_Point.Y = 61
$richTextBox1.Location = $System_Drawing_Point
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 562
$System_Drawing_Size.Height = 454
$richTextBox1.Size = $System_Drawing_Size
$richTextBox1.TabIndex = 1 $form1.Controls.Add($richTextBox1) $System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 224
$System_Drawing_Size.Height = 563
$treeView1.Size = $System_Drawing_Size
$treeView1.Name = "treeView1"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 13
$System_Drawing_Point.Y = 37
$treeView1.Location = $System_Drawing_Point
$treeView1.DataBindings.DefaultDataSourceUpdateMode = 0
$treeView1.TabIndex = 0 $form1.Controls.Add($treeView1) #endregion Generated Form Code #Save the initial state of the form
$InitialFormWindowState = $form1.WindowState
#Init the OnLoad event to correct the initial state of the form
$form1.add_Load($OnLoadForm_StateCorrection)
#Show the Form
$form1.ShowDialog()| Out-Null } #End Function #Call the Function
GenerateForm

@ 去下面的网站下载免费的工具

可以去这个网站下载一个免费的工具,https://www.sapien.com/download,唯一遗憾的是,这个网站需要注册才能下载。

@ 去微软的网站下载

https://www.microsoft.com/en-us/download

PowerShell的学习笔记(2)相关推荐

  1. PowerShell学习笔记(1)-基础

    PowerShell学习笔记(1):基础   前段时间在知乎上得知Windows下的一款强大的命令行工具PowerShell(原谅我刚刚得知). 其强大的功能,令人惊叹,兴趣盎然,这么优秀的工具值得我 ...

  2. PowerShell 学习笔记 - 2 PS Module

    PowerShell 学习笔记 - 2 PS Module 本章主要探讨 PowerShell 的模块化,由于 PowerShell Core 现版本下已经移植的模块较少以及存在大量强依赖于平台的功能 ...

  3. PowerShell 学习笔记 - 1 PS Core 基础

    PowerShell 学习笔记 - 1 PS Core 基础 本章主要探讨 PowerShell 核心,主要基于 Linux 平台上的 PowerShell Core 实现,实际上于 Windows ...

  4. Powershell学习笔记——函数和函数库

    前段时间公司封闭开发,就在封闭的前一天感冒发烧,为了封闭,一顿猛药下去,烧是退了,却在扁桃附近爆发出来--扁桃发炎加溃疡,搞了十多天才好啊,天天喝稀饭啊--所以请大家原谅这么久没有续上学习笔记.顺便: ...

  5. Sharepoin学习笔记—架构系列—Sharepoint服务(Services)与服务应用程序框架(Service Application Framework) 1

    Sharepoin学习笔记-架构系列-Sharepoint服务(Services)与服务应用程序框架(Service Application Framework) 1 Sharepoint服务是Sha ...

  6. Nodejs学习笔记(一)——基础之全局对象、包和npm

    [目录] Nodejs学习笔记(二)--模块 Nodejs学习笔记(三)--同步和与异步之文件系统模块 Nodejs学习笔记(四)--http协议与服务器 Nodejs学习笔记(五)--express ...

  7. nodejs学习笔记(上)

    nodejs学习笔记 (上) 通过学习需要做到的是 了解 前后端是如何进行交互的 nodejs也是使用javaScript进行编写的 javaScript在不同的运行环境中有不同的作用 在浏览器内核中 ...

  8. node.js学习笔记Day2

    目录 第一部分:用npm安装mysql模块 第二部分:在项目内创建 第三部分:引用opreateDB方法 第四部分:解决异步方法的问题 第五部分:关于热启动 第六部分:关于接收参数和带参查询数据 今天 ...

  9. vim从入门到丝滑学习笔记

    vim学习笔记 入门 vim模式:(界面左下角有显示) api帮助文档 Ctrl+S造成vim假卡死 基本指令 operator操作符 motion动作 移动 水平移动(行内) 垂直移动(行间) 编辑 ...

最新文章

  1. iOS下JS与OC互相调用(四)--JavaScriptCore
  2. 管理序列+序列的伪列+修改序列+删除序列
  3. hystrix源码小贴士之Yammer Publisher
  4. v-for获取(循环次数)对象的length长度
  5. Facebook开源新的压缩算法,性能超zlib
  6. paip.wmv的无损分割与截取
  7. 起源故事:瓮城、沙盒与可信计算
  8. 基于RRT算法的路径规划
  9. SSS1700设计方案|SSS1700中文说明书
  10. 网站链接被微信屏蔽禁止访问的解决办法
  11. ssh登录一直提示修改密码解决
  12. EMR 上的 Spark 或 Hive 作业失败并出现 HTTP 503 “Slow Down” AmazonS3Exception
  13. 社交媒体视频字幕AE模板 Podcast Badges for After Effects
  14. 使用lucene的多字段排序--回复网友BUFFON
  15. 太用力的人跑不远,android开发视频
  16. #define 喵 int_招行10元风暴第4轮出喵攻略
  17. 如何学习一门计算机语言?
  18. 【开源】司马编译器结构
  19. 日本老爷爷坚持17年用Excel作画,我可能用了假的Excel
  20. matlab采用粒子群优化算法求解含压缩储能设备的综合能源系统运行优化

热门文章

  1. Lemon Tree
  2. 能发出外链的论坛从哪里来?
  3. 全球限量99辆!宝马推出8系艺术车
  4. 基于JEECG-BOOT的list页面的地址栏参数传递
  5. 海外优秀资讯抢先看10:世界著名软件缺陷导致的灾难性案例详解之阿丽安娜火箭之殇
  6. 【云云怪】第7个项目:自动跑鹰眼
  7. wsgiserver python 漏洞_新型任意文件读取漏洞的研究
  8. 三维空间中的几何变换-平移旋转缩放
  9. 交换链路聚合、堆叠、集群技术(HCIA)
  10. Adobe软件安装方法