CmdletBindingAttribute之HelpURI的作用
来源:互联网 发布:易语言qq自动回复源码 编辑:程序博客网 时间:2024/06/05 05:20
PowerShell 3.0更新了许多新功能,尤其在Advanced Function中也有一些新特新改进,我们会接下来分篇幅分别讲解一下这些新特新。
今天我们要说的就是新增的CmdletBinding的HelpURI属性。HelpURI属性可以为你的方法,脚本函数指定一个在线版本的帮助文档,所有指定的链接方式都必须用http和https开头。
Function New-PowerShell{ [CmdletBinding(HelpURI='http://www.microsoft.com')] Param ( [Parameter()] $StringData ) Write-Host $StringData}Get-Help New-PowerShell -Online
当你,使用参数Online参数时候就会自动链接打开'http://www.microsoft.com'链接。
这里要提到一点就是,相信大家一定记得在Comment-Based Help中,有一个".LINK" 节点,它在PowerShell文档中的作用也是起到帮助链接的作用,那么如果我此时开始HelpURI后,又同时设定Comment-Based Help,到底是哪个优先呢?
Function New-PowerShell{<#.SYNOPSIS test new feature in PowerShell 3.0.EXAMPLE New-PowerShell.LINK http://www.baidu.com#> [CmdletBinding(HelpURI='http://www.microsoft.com')] Param ( [Parameter()] $StringData ) Write-Host $StringData}Get-Help New-PowerShell -Online
大家在测试后,一定会发现,如上示例会自动跳转到http://www.baidu.com,也就是Comment-Based Help的优先级优于HelpURI。
- CmdletBindingAttribute之HelpURI的作用
- CmdletBindingAttribute之PostionalBinding的作用
- CmdletBindingAttribute之SupportsPaging的作用
- 感想之blog的作用
- 读书笔记之final的作用
- Spring之ContextLoaderListener的作用
- Spring之ContextLoaderListener的作用
- Spring之ContextLoaderListener的作用
- Oracle之监听的作用
- Spring之ContextLoaderListener的作用
- Redis 之 Redis的作用
- Spring之ContextLoaderListener的作用
- Spring之ContextLoaderListener的作用
- Spring之ContextLoaderListener的作用
- Spring之ContextLoaderListener的作用
- Spring之ContextLoaderListener的作用
- Spring之ContextLoaderListener的作用
- Spring之ContextLoaderListener的作用
- TCP的socket的服务器端和客户端实例(linux下)
- Android中的visibility属性的区别
- 码农的恋爱观:只有程序员能看懂
- 双链表
- 常用Eclipse快捷键
- CmdletBindingAttribute之HelpURI的作用
- 不错的matlab网站(更新ing)
- 2012年软件开发者薪资调查报告
- 代码清单5-1使用raw_input()得到一个字符串
- MapReduce实现大矩阵乘法
- JFFS2
- 栈实现进制转换
- ActiveMQ - stomp 通过自定义转换器来支持 Map 消息传递
- Topological sorting