Ste*_*idi 5 powershell default-value powershell-2.0
我有以下简单的脚本,它接受文本作为输入并将其写入主机.
<#
.SYNOPSIS
Writes the input string to the host.
.PARAMETER Text
The text to write to the host.
#>
param([string]$text = "hello world!")
Write-Host $text
Run Code Online (Sandbox Code Playgroud)
要呈现此脚本的帮助,我在Powershell会话中执行以下命令,其中write-text.ps1是此脚本的名称.
get-help .\write-text.ps1 -full
Run Code Online (Sandbox Code Playgroud)
在下面的输出中,我希望看到帮助中列出的脚本参数的默认值 - 但我没有:
PARAMETERS
-text <String>
The text to write to the host.
Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters?
Run Code Online (Sandbox Code Playgroud)
我需要在此脚本中添加或更改帮助引擎以呈现默认参数值?
| 归档时间: |
|
| 查看次数: |
860 次 |
| 最近记录: |