在PowerShell 5.0 Get-Help中,不显示脚本的基于注释的帮助.而是仅打印文件名.
对于此代码,不显示注释块的值:
# dare.ps1
<#
.SYNOPSIS
The answer
.DESCRIPTION
Answer to the Ultimate Question of Life, the Universe, and Everything.
#>
"The answer to the Ultimate Question of Life, the Universe and Everything is {0}" -f 42
Run Code Online (Sandbox Code Playgroud)
PS C:\> Get-Help .\dare.ps1
Run Code Online (Sandbox Code Playgroud)
dare.ps1
Run Code Online (Sandbox Code Playgroud)
基于注释的帮助的打开需要在第一行,或者在第一个注释或代码与基于注释的帮助块之间需要更多空间.
# dare.ps1
<#
.SYNOPSIS
The answer
.DESCRIPTION
Answer to the Ultimate Question of Life, the Universe, and Everything.
#>
"The answer to the Ultimate Question of Life, the Universe and Everything is {0}" -f 42
Run Code Online (Sandbox Code Playgroud)
<#
.SYNOPSIS
The answer
.DESCRIPTION
Answer to the Ultimate Question of Life, the Universe, and Everything.
#>
"The answer to the Ultimate Question of Life, the Universe and Everything is {0}" -f 42
Run Code Online (Sandbox Code Playgroud)
NAME
C:\dare.ps1
SYNOPSIS
The answer
SYNTAX
C:\dare.ps1 [<CommonParameters>]
DESCRIPTION
Answer to the Ultimate Question of Life, the Universe, and Everything.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
103 次 |
| 最近记录: |