Getting Help

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
1 hour 43 minutes
Difficulty
Intermediate
CEU/CPE
2
Video Transcription
00:00
Hello, everyone. I'm instructor Gerry Roberts, and this is Power Shell scripting.
00:06
You know, sometimes when you're working in power show, you might need a little bit of assistance on this module. We're gonna talk about how to get that.
00:13
We're gonna talk about getting help in power show. We're gonna talk about the helps in tax, some information about parameters and piping till some helpful hints toe help you along your way. Then we're going to switch a little bit over two partial I s C.
00:29
And then last but not least, we're gonna talk about some additional help that you can get
00:36
getting help in Power Shell. There are three commands in power shell that you can actually use to get some help.
00:41
There's get Dash, help,
00:43
help and man
00:45
get dash Help is a built in CMG. Let that allows you to get information about a command.
00:53
Help is actually a built in function you can use to get information about command.
00:59
A man is actually Justin alias for help. Those exact same thing is help.
01:03
Only it's the Lenox friendly version. So if you're used to working in Lenox,
01:08
you have your man command. Here is well,
01:12
the syntax for help.
01:15
So when you run a help command, you actually get ah, couple different things that have returned about the command you're looking up.
01:25
There's a section in here called Syntax. This is actually very important because it helps you understand how to use to commit and how it's actually written out.
01:37
You'll see in the picture here.
01:40
There's a lot of stuff
01:42
you'll see Get Dash Command,
01:44
which was the one we looked for help for,
01:47
and you'll see a lot of different parameters and other things like dash name, dash, argument list and so forth.
01:57
Any items in the square brackets are considered parameters. So again, dash name dash argument list dash all etcetera
02:07
items, and the less than greater than brackets are objects or parameter values,
02:15
so you can see here under name. It can take a string so you could put in values in, say, words or sentences.
02:25
Items in the curlicue brackets are usually a list of items that could be valid parameters.
02:31
So if you look at command type,
02:35
you'll see you have, like alias function, filter all those other things that you can put it in there.
02:40
Items separated by a pipe, a representative of multiple items in the valid parameter list.
02:47
Thio again. When you look at command tight, you can see Alias function filter, etcetera that could all be valid values for that particular parameter For a couple other things about parameters.
03:01
Help documentation actually does include some more robust information, not just that. Little less there that could tell you about parameters are available.
03:12
This information helps. You better understand what the parameters are,
03:15
and that understanding does help you write better commands and scripts to do things you want to do.
03:23
If you want to see more information about a parameter
03:27
when you're doing the help command or the get help her man
03:30
at the end of the command, do the dash full switch,
03:36
and this will give you a lot more information. So some things you'll see when you pull up parameters how you'll actually see data type. This is just what kind of information it can take. For example, when we talked earlier about string, that just means it takes in a string of values such as a word sentence
03:52
required.
03:53
That means you have to provide a value for that parameter in order for the command to work. So if it says required, yes, that means you need to put something there.
04:02
Position now. One of the things about commands in power Shell is in some cases, you don't have to provide the parameter name. If a value is provided in a certain position in the command,
04:16
the system automatically knows what that parameter is and doesn't need the name. Now that's not all commands,
04:26
Um, and not all parameters.
04:28
So be wary of that
04:30
default value. Sometimes Power Show will fill in a default value for a parameter. If there is one, it will show what is in the description and give you further information.
04:42
Another couple things here that have more to do with how the command works except pipeline input and accept wildcard characters. Pipeline input means whether or not you can actually pipe something with the command. Some commands don't let you use a pipe.
04:59
The wild card. Whether or not you can use wild cars for parameter values that could be like percentages or asterisks or things like that. In some cases, you can use wild cards that does help you find things. In other cases, it will let you use a wild card. Do you have to use the full value?
05:18
So what? Actually his A pipe? Wild cards were pretty easy to understand, but pipes are a little bit more complex when it comes to commands.
05:30
So, according to Microsoft pipelines, act like a series of connected segments of a pipe.
05:35
Items moving along the pipeline passed through each segment to create a pipeline and power shell. You connect the commands together with a pipe operator, which is that up and down line.
05:46
The output of each command is used as input for the next command. What is that all be? Basically, it just means pipes are going to allow you to use multiple commands together. Each command takes the output from the previous command. And an important thing here to understand is that command.
06:05
It's not gonna take
06:08
the text from the previous command. It's going to be the output from the previous command. For example, get dash printers,
06:15
space pipe space, F l.
06:19
The command there is going to get all of the printers then is going to format it in a list. So what will happen is that f l there that formatted list is gonna grab everything from get printers and make a pretty little list for you.
06:35
Some helpful hints when working in Power show
06:40
used the up barrow to numerator commands you previously done. This is very similar to some other command line systems. All you do is up or down, and you could scroll through what you've already written
06:53
used the clear Command to clear out your power show window. So if you type the word clear, it'll clear everything out and you'll start with a nice, clean power show window.
07:01
You can also use the tab key to complete commands or tab complete.
07:06
This is not 100% accurate. However, it's fairly accurate.
07:14
It works pretty similar. If you're used to like the Cisco IOS system are other systems like that where you start to type of command and you use the tab key. Now what it'll do on regular power shell is when you hit Tab and allow you to scroll through commands that are similar to what you're typing.
07:33
Now, when we get to Power Shell I S C.
07:36
It's a little different. There are actually some better helpful things.
07:41
Their first helpful item is the power show. Uh, intelligence. Now, if you've worked with visual studio or some other products, you might be familiar with intel. A sense basically is a code completion aid supposed to help you complete commands in a visual way instead of having to tab
08:00
they're using tab complete.
08:01
You can see on the right hand side here this picture, we're trying to get to command, and it shows us a list of what kind of get commands we can use when you start typing Maur. It actually does make the list shorter because it'll find what you are exactly starting to type.
08:22
Went on.
08:22
It's gonna display that list based on what you typed. So you can see there. I only type to get dash, so there's a whole lot of commands again. If I started typing a little more, that list would tighten up.
08:35
Another item is the command search. This is actually a really cool item that they have impartial. I s C. This allows you to search for a command through a list of commands. Pretty much you start typing the command as you can see here on the right, and they'll give you a nice little list.
08:56
This is nice, because if you can't remember exactly what a command is, you can actually type different words
09:01
in the command. It will find it. So instead of just intel, a sense that finds it based on what you've started typing. If you were to type just a work, for example here, if you were to type Alias, you would get a list of all the commands that had the word alias in it
09:18
instead of intelligence where you just did get Dash A and it found it that way.
09:22
So it's kind of very useful, allows you to do key. Words are just things like that, so you can find commands a little bit easier if you want to use it in I s C U Go to view and show command at on, and it shows up on the right. It's very useful.
09:37
Additional help with Power show
09:39
You do have about files that you can access in power show.
09:46
There's also a couple parameters. Show window and show command give you some more information about what you're working with,
09:54
and the Microsoft Docks website is super useful for getting help us. Well, that's https colon forward slash forward slash and docks that Microsoft dot com
10:05
Ford slash and Dash US for Tash Power Show. And again, if you're in another country,
10:11
go to your country's landing page for Microsoft documents, which is usually just stocks up Microsoft dot com and then type in power show, and it should bring you directly to the power shell page. All right, it's post assessment time. So if you wanted to get help
10:30
Ah, for the get a D group command, what command would you use?
10:35
Would you use help, get 80 group
10:37
man, get 80 group
10:39
or get
10:41
dash help get 80 group? Or would it be all of those above? You can go ahead and pause for a second,
10:48
and then once you're ready, we'll get the answer.
10:52
Answer is actually all of the above Help man and get dash help are all valid commands you can use to get information about a command.
11:03
So in this video, we talked a little bit about how to get help for power show
Up Next