Powershell HELP Example

Hi

I am taking a online Powershell course and it has informed me about a very powerfull feature where you can get help on any command.

I tried “help dir” and got the desired result

But when I tried “help dir -example”

It get me the same result as the first command, i did not get any example which would help me a great deal.

Can somebody help me with this issue please

Des

Desmond,
welcome to the forums.

I’d recommend to avoid aliasses at all - at least until you get more familiar with PowerShell. Instead of using aliasses I’d use tab completion. It reduces the letters needed to be typed as well but it is less error prone and helps maintaining a better style. You should avoid aliasses in general for scripts or when you’re about to show some code for others like in forums. :wink:

The actual command PowerShell runs when you use the alias dir is Get-ChildItem. And for help it is Get-Help.

So the proper command for you would be:

Get-Help Get-ChildItem -Examples

Other useful parameters for the cmdlet Get-Help are -Full or -ShowWindow or -Online.
To see the full list of possible parameters you can run

Get-Help Get-Help -Full
1 Like

Olaf
Thank you for your reply, your advice will be taken on board. After testing your command

Get-Help Get-ChildItem -Examples

I still do not get any “examples” of how the command is used.

Any idea why this is happening?

And what do you get?

Not without a lot of more details from you, sorry. Have you tried to update the help?

Have you tried the other recommendations I gave? You know you always can access the help online, don’t you? :wink:

Thanks Olaf

I will use the online Help facility.

Regards
Desmond