Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell get-help not returning proper help syntax

Tags:

powershell

When typing get-help ls from the file system in Powershell 4.0 or Powershell 5.0 on Windows 7, I get:

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>]

I am expecting to see another entry that includes information on the -Attributes parameter.

Trying to force it, with get-help ls -Path C: gives me the same result.

Trying again to force it, with get-help ls -Parameter Attributes gives the following error

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

However, I can still run queries such as ls -Attributes d that return the appropriate result. In this case, a list of all directories in the current directory.

I have tried reinstalling WMF. I have tried reinstalling the help documentation with Update-Help -force. I am completely stumped here.

like image 928
William Denman Avatar asked Dec 02 '25 16:12

William Denman


1 Answers

Success! Here is what I did to get it to work.

Ran Save-Help to save a local copy of the help files on disk.

Then ran Update-Help -SourcePath filePath to use those downloaded files to update help.

It does not make any sense why Update-Help -force was not working. I can only guess that perhaps my company's system is setup to use a local copy of the help files, but manually downloading the files forces it to use Microsoft's.

Interestingly enough, running Get-Help Get-ChildItem -Path $null as discussed in the help files does not give information about the Get-ChildItem cmdlet in all drives. I had to write get-help ls -Path Registry::hklm:\

like image 124
William Denman Avatar answered Dec 04 '25 17:12

William Denman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!