I am frequently making calls such as:
get-help <some-command>
in Powershell 2. For many, but not all, of these commands, I am not shown the contents of the help entry. Instead, I get duplicates, and only the help object itself is displayed:
[PS2]> get-help remove-distributiongroup | more
Name Category Synopsis
---- -------- --------
Remove-DistributionGroup Cmdlet Use the Remove-DistributionGroup...
Remove-DistributionGroup Cmdlet Use the Remove-DistributionGroup...
Being a complete PS novice, I hack around this by doing something similar to the following:
[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 ...
Couple of questions.
- Will my Windows admin co-workers know how to remove the duplicate entries? I'm just a Unix guy.
- If not, is there an easier method to get what I need instead of the convoluted hack I came up with above?
Thanks!
[UPDATE[:
Tried pk's suggestion, but sadly that didn't work. Here's the output when piped through select -unique:
Name Category Synopsis
---- -------- --------
Get-DistributionGroup Cmdlet Use the Get-DistributionGroup cm...