Now that we have help installed, let me show you how to use it.
It's actually really quite easy. You can just type the word help
and then whatever it is you want to find help on.
Tell me everything you know PowerShell. Give me some help on everything that has
process in the name. So I can do help *process*. Okay, not too bad. I can see a
list there. Looking at the list, I can then fine tune that. Maybe I just want to
do help *process, so I don't want anything that has something after process.
Narrows it down a bit more, and I can see, oh, there's some Get‑Process,
Stop‑Process, Wait‑Process.
So let's look at another way, and that is using get‑command.
Get‑command has a ‑noun parameter, so I can say, hey,
find all the commands that have a noun of process, simplifies it even further.
So you can find commands or discover things by how they're
using the help system or get‑command.
Of course,
once you find the command, like say Stop‑Process you want to know, hey,
how do I use this command? Now you can do help. Here I'm going to use
get‑help. Again, I want to demonstrate that when you do this this scrolls
all the way through versus if I run help stop‑process, this does the
paging. So I kind of am in the habit, and I expect you'll get in the
habit of using the help command.
It's the same content. Only difference really between help and get‑help is that
help pipes it to the more command automatically for you so you don't have to do
anything other than kind of page through and look at the help that you need.
So, let's clear the screen here. So we've got get‑help or the help command.
Help is the easier way to go.
You can also get help from an alias.
Or you might say,
what is the PowerShell help for the dir command? So you do help dir,
even though you may not know what the PowerShell command is. PowerShell
will resolve the alias, and you can see, oh,
the command is actually Get‑ChildItem.
So now I can go through and I could look at all the help for Get‑ChildItem,
and that would be the same thing as dir. Or this happens a lot, because
you'll see some code on the internet or someplace, and you'll see someone
with a command called gsv and wonder, well,
I don't know what that is, so just asked for help.
So do help gsv and see, oh,
that's Get‑Service. It would certainly be nicer if they just typed out
Get‑Service, but sometimes people will use aliases,
and that's, that's an okay sort of thing to do, but you can use
help to discover what the actual commands are and then how to use
that command, in this case via its alias.
If you're on a Windows machine,
you can actually look for another alias, man. On the
Linux system, man, is how we get help,.
Um, so that's kind of cool. In fact, here, look at this. I can do man man, so I get help on help.