【发布时间】:2018-07-09 00:22:42
【问题描述】:
我正在尝试使用 Get-Help cmdlet 以与显示从 XML 文件生成的 cmdlet 帮助主题相同的格式显示基于注释的帮助。这样做的能力记录在 TechNet 上的 about_Comment_based_Help 中,但是当我对我的脚本执行 get-help cmdlet 时,我只得到返回的脚本名称。任何帮助将不胜感激!
PS C:\Admin> Get-Help .\checksystem.ps1 -full
checksystem.ps1
checksystem.ps1 脚本:
function IsAlive {
<#
.DESCRIPTION
Checks to see whether a computer is pingable or not.
.PARAMETER computername
Specifies the computername.
.EXAMPLE
IsAlive -computername testwks01
.NOTES
This is just an example function.
#>
param (
$computername
)
Test-Connection -count 1 -ComputerName $computername -TimeToLive 5 |
Where-Object { $_.StatusCode -eq 0 } |
Select-Object -ExpandProperty Address
}
IsAlive -computername 192.168.1.1
【问题讨论】: