I wish Get-Help showed the -Detailed
information by default and had paged output. I wrote a function called "Help" to do that, but it doesn't handle parameters beyond the cmdlet to get help about. I was hoping splatting would work to pass-through the extra parameters, but it doesn't. Here's my naive attempt:
function Help { Get-Help -Detailed @args | less}
It works fine if you just call it with one parameter, like help Get-ChildItem
, but if you call with more, like help Get-ChildItem -Parameter Path
it gives an error:
Get-Help : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:17
+ function Help { Get-Help -Detailed @args | less}
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-Help], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.GetHelpCommand
Does anyone know if there's a way to do this that's not terribly ugly?
I noticed this and this similar answers, but they don't work for the case above.