Powershell get-help没有返回正确的帮助语法



当在Windows 7上的Powershell 4.0或Powershell 5.0的文件系统中输入get-help ls时,我得到:

SYNTAX
Get-ChildItem [[-Path] <String[]>] [[-Filter] <String>] [-Exclude <String[]>] [-Force] [-Include <String[]>] [-Name] [-Recurse] 
[-UseTransaction [<SwitchParameter>]] [<CommonParameters>]
Get-ChildItem [[-Filter] <String>] [-Exclude <String[]>] [-Force] [-Include <String[]>] [-Name] [-Recurse] -LiteralPath <String[]> 
[-UseTransaction [<SwitchParameter>]] [<CommonParameters>]

我希望看到另一个包含-Attributes参数信息的条目。

试图强迫它,与get-help ls -Path C:给我相同的结果。

再次尝试强制它,get-help ls -Parameter Attributes给出以下错误

get-help : No parameter matches criteria Attributes.
At line:1 char:1
+ get-help ls -Parameter Attributes
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (System.Manageme...CommandHelpInfo:ProviderCommandHelpInfo) [Get-Help], PSArgumentException
+ FullyQualifiedErrorId : NoParmsFound,Microsoft.PowerShell.Commands.GetHelpCommand

但是,我仍然可以运行查询,例如返回适当结果的ls -Attributes d。在本例中,是当前目录下所有目录的列表。

我已经尝试重新安装WMF。我已经尝试重新安装Update-Help -force的帮助文档。我完全被难住了。

成功!下面是我为使它工作所做的。

运行Save-Help将帮助文件的本地副本保存在磁盘上。

然后运行Update-Help -SourcePath filePath使用这些下载的文件来更新帮助。

为什么Update-Help -force不工作没有任何意义。我只能猜测,也许我公司的系统被设置为使用帮助文件的本地副本,但手动下载这些文件迫使它使用微软的。

有趣的是,像帮助文件中讨论的那样运行Get-Help Get-ChildItem -Path $null并没有给出关于所有驱动器中Get-ChildItem cmdlet的信息。我必须写get-help ls -Path Registry::hklm:

最新更新