Lar*_*old 5 powershell documentation
我经常拨打这样的电话:
get-help <some-command>
Run Code Online (Sandbox Code Playgroud)
在 Powershell 2 中。对于这些命令中的许多(但不是全部),我没有看到帮助条目的内容。相反,我得到重复项,并且仅显示帮助对象本身:
[PS2]> get-help remove-distributiongroup | more
Name Category Synopsis
---- -------- --------
Remove-DistributionGroup Cmdlet Use the Remove-DistributionGroup...
Remove-DistributionGroup Cmdlet Use the Remove-DistributionGroup...
Run Code Online (Sandbox Code Playgroud)
作为一个完全的 PS 新手,我通过执行类似于以下的操作来解决这个问题:
[PS2]> $var = get-help remove-distributiongroup
[PS2]> $var[0] | get-member
... Output ...
[PS2]> $var[0].Parameters |more
... Part of the documentation ...
[PS2]> $var[0].Synopsis |more
... Another part of the documentation ...
Run Code Online (Sandbox Code Playgroud)
有几个问题。
谢谢!
[更新[:
尝试了pk的建议,但遗憾的是这没有用。这是通过 select -unique 进行管道传输时的输出:
Name Category Synopsis
---- -------- --------
Get-DistributionGroup Cmdlet Use the Get-DistributionGroup cm...
Run Code Online (Sandbox Code Playgroud)
我不确定为什么你会收到重复的信息。我无法重现这个问题,但我确实知道如何以稍微更优雅的方式解决它。
get-help remove-distributiongroup | select -unique
Run Code Online (Sandbox Code Playgroud)
那样有用吗?
这会返回什么?
Test-Path -path "$pshome\Help.format.ps1xml"
Run Code Online (Sandbox Code Playgroud)
此文件包含由 Get-Help 返回的 MamlCommandHelpInfo 对象的格式化视图。
| 归档时间: |
|
| 查看次数: |
1720 次 |
| 最近记录: |